+ Reply to Thread
Results 1 to 13 of 13

Auto selection of Check box in one form based on value of combobox from other form.

  1. #1
    Registered User
    Join Date
    07-10-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    33

    Auto selection of Check box in one form based on value of combobox from other form.

    Hi All,

    I have two user forms in my excel sheet. In one form user needs to select ID from combo box and name of user auto populates in text box. When users press OK button in this form, it opens another form which has check boxes. I want auto ticked check boxes based on selection of ID in previous form. Based on selcetion of check boxes in this form, respective sheet would be activated.

    If user has selected ID "001" from one form and in the second form ,"001" should be ticked automatically and other check boxes should be deactivated as well.

    I have completed the coding of First form but I am not able to get any solution for auto ticking of check boxes.

    Please help.

    Many thanks.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Auto selection of Check box in one form based on value of combobox from other form.

    How are you opening the second form from the first?

    Also, how can the correct checkbox be identified in the second form from what's been selected in the first form?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    07-10-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    33

    Re: Auto selection of Check box in one form based on value of combobox from other form.

    Dear Norie,

    Many thanks for your reply.

    Once user press "OK" button in the first form then only second form opens.

    For second question, I have not given a thought. But i would like to ensure the second question as well. Thanks for raising this.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Auto selection of Check box in one form based on value of combobox from other form.

    So is the second form opening by magic, or are you using code to open it?

  5. #5
    Registered User
    Join Date
    07-10-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    33

    Re: Auto selection of Check box in one form based on value of combobox from other form.

    Dear Norie,

    Second form is opening by selecting the "OK" button from first from. The complete code which I have used til now is

    Please Login or Register  to view this content.
    This code populates name in text box after selection of ID from combobox in form 1.
    Please Login or Register  to view this content.
    This code opens the second form when user selects OK button in from1.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Auto selection of Check box in one form based on value of combobox from other form.

    Well since you aren't unloading the first form you have access to the textbox/combobox values on it so you should be able to use them to select the correct checkbox in the second form.

  7. #7
    Registered User
    Join Date
    07-10-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    33

    Re: Auto selection of Check box in one form based on value of combobox from other form.

    Dear Norie,

    I want to auto select the correct check box on second form with respect to ID selected in first form. But I am not expert in vba. So I don't know how to do this. I searched and didn't find any way to do this. Could you please help me on this.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Auto selection of Check box in one form based on value of combobox from other form.

    I don't know anything about your forms so I can't really help with that right now.

    By the way, what does the second form do?

  9. #9
    Registered User
    Join Date
    07-10-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    33

    Re: Auto selection of Check box in one form based on value of combobox from other form.

    Dear Norie,

    Please find attached sample file which I have created for you.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    07-10-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    33

    Re: Auto selection of Check box in one form based on value of combobox from other form.

    Dear Norie,

    Second form adds the data into respective sheet based on selection of checkboxe in second form. When you select the checkbox manually, it activates the respective sheet and add data into sheet based on selection of fields in second user form 2.

    Many thanks.

  11. #11
    Registered User
    Join Date
    07-10-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    33

    Re: Auto selection of Check box in one form based on value of combobox from other form.

    Dear All,

    Could someone please help me on this?

    Thanks

  12. #12
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Auto selection of Check box in one form based on value of combobox from other form.

    I'm not quite sure why you are using checkboxes, why not just use a textbox on the second form?

    Anyway, replace the existing code for the OK button with this.
    Please Login or Register  to view this content.
    Last edited by Norie; 08-28-2014 at 09:01 AM.

  13. #13
    Registered User
    Join Date
    07-10-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    33

    Re: Auto selection of Check box in one form based on value of combobox from other form.

    Dear Norie,

    Many thanks for your help. It is working fine.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 01-02-2014, 10:38 AM
  2. how to assign a different macro to each*combobox selection in form control....
    By kritigupta in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-03-2012, 03:04 AM
  3. how to assign a different macro to each*combobox selection in form control....
    By kritigupta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2012, 07:51 PM
  4. Populating form text box on combobox selection.
    By samtwilliams in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-22-2007, 04:38 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1