+ Reply to Thread
Results 1 to 22 of 22

Dependent ComboBox on Form

  1. #1
    Registered User
    Join Date
    06-05-2018
    Location
    Minneapolis, MN
    MS-Off Ver
    365 ProPlus
    Posts
    31

    Dependent ComboBox on Form

    Hello Friends,

    I need some help with dependent combo boxes.... I have gotten so far in building a form but just can't figure out these dependent drop downs.

    I have 3 drop downs, the first is just normal, then the next should be based on what shows up in the first and the 3rd is based on what shows up in the 2nd.

    The drop down categories are: Category, then Parent Vendor (which should change based on the category) then Sub Vendor (which should changed based on the Category and Parent Vendor). I have created lists of what belongs where already and have tried different ways to get this to work but haven't been able to get it working.

    Someone please help!
    Attached Files Attached Files
    Last edited by heimk008; 09-10-2018 at 11:46 AM.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,029

    Re: Dependent ComboBox on Form

    Some of the categories are blank. Should those rows be ignored?

  3. #3
    Registered User
    Join Date
    06-05-2018
    Location
    Minneapolis, MN
    MS-Off Ver
    365 ProPlus
    Posts
    31

    Re: Dependent ComboBox on Form

    They will eventually be filled. I am still working with my boss to fill them, so for now they can either be ignored or have a made up category.

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Dependent ComboBox on Form

    Like this:
    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,029

    Re: Dependent ComboBox on Form

    Keep the code for the 2 command buttons & replace the rest with
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Fluff13; 09-10-2018 at 10:25 AM.

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Dependent ComboBox on Form

    Actually, my init procedure could be simplified to
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-05-2018
    Location
    Minneapolis, MN
    MS-Off Ver
    365 ProPlus
    Posts
    31

    Re: Dependent ComboBox on Form

    Thank you both for such quick responses!

    If I need to add more to any of the 3 categories do I just add a line to the bottom of the first table or do I need to do anything else?

  8. #8
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Dependent ComboBox on Form

    Just add a line to the bottom, that's the case for either mine or fluff's, both of which essentially work in the same way

  9. #9
    Registered User
    Join Date
    06-05-2018
    Location
    Minneapolis, MN
    MS-Off Ver
    365 ProPlus
    Posts
    31

    Re: Dependent ComboBox on Form

    Perfect! thanks so much!

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,029

    Re: Dependent ComboBox on Form

    Glad we could help & thanks for the feedback

  11. #11
    Registered User
    Join Date
    06-05-2018
    Location
    Minneapolis, MN
    MS-Off Ver
    365 ProPlus
    Posts
    31

    Re: Dependent ComboBox on Form

    Hi,

    One more thing, on for the Invoice form, could you help me make the PO number be a combo box that only lets you choose from those that are listed in the PO Number column on the POs tab?

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,029

    Re: Dependent ComboBox on Form

    If they are unique values, add this to the Intialise event (either mine or Kyle's)
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    06-05-2018
    Location
    Minneapolis, MN
    MS-Off Ver
    365 ProPlus
    Posts
    31

    Re: Dependent ComboBox on Form

    does it matter where i past it within the event?

  14. #14
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,029

    Re: Dependent ComboBox on Form

    No, shouldn't make any difference.

  15. #15
    Registered User
    Join Date
    06-05-2018
    Location
    Minneapolis, MN
    MS-Off Ver
    365 ProPlus
    Posts
    31

    Re: Dependent ComboBox on Form

    i added it in and updated the cbo box name throughout the rest of the code and now I get a "Run-time error '381': Could not set the list property. Invalid poperty array index (see attached)
    Attached Files Attached Files

  16. #16
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,029

    Re: Dependent ComboBox on Form

    It's because you only have 1 row of data in the POs sheet. You need at least 2 values.
    If this is a problem it can be easily changed.

  17. #17
    Registered User
    Join Date
    06-05-2018
    Location
    Minneapolis, MN
    MS-Off Ver
    365 ProPlus
    Posts
    31

    Re: Dependent ComboBox on Form

    got it. there usually wouldn't be that few. i added one more and it worked!

    thanks!

  18. #18
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,029

    Re: Dependent ComboBox on Form

    You're welcome & thanks for the Rep

  19. #19
    Registered User
    Join Date
    06-05-2018
    Location
    Minneapolis, MN
    MS-Off Ver
    365 ProPlus
    Posts
    31

    Re: Dependent ComboBox on Form

    Fluff13,

    Could you help me add another dependent into the mix? I tried going through the code to figure it out myself but just can't...

    I need Category to remain the top one, but now I need Budget to depend on Category and then ParentVendor to depend on Budget and SubVendor to depend on ParentVendor.
    Attached Files Attached Files

  20. #20
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,029

    Re: Dependent ComboBox on Form

    Try
    Please Login or Register  to view this content.

  21. #21
    Registered User
    Join Date
    06-05-2018
    Location
    Minneapolis, MN
    MS-Off Ver
    365 ProPlus
    Posts
    31

    Re: Dependent ComboBox on Form

    Perfect! Thank you!

  22. #22
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,029

    Re: Dependent ComboBox on Form

    Glad to help & thanks for the feedback

+ 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. User Form Dependent Dropdown (ComboBox)
    By tmleynek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-15-2015, 04:45 PM
  2. Populate combobox dependent on contents of previous combobox
    By ed1967 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 10-08-2014, 11:40 AM
  3. Populating combobox dependent on another combobox
    By JChaney17 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2014, 12:36 PM
  4. [SOLVED] UserForm: ComboBox #2 dependent on ComboBox #1
    By TexasAggie12 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-25-2014, 10:41 AM
  5. [SOLVED] VBA ComboBox Value Dependent on Conditional Value from Another ComboBox
    By Brianandstewie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-04-2013, 02:35 AM
  6. [SOLVED] Userform with two combobox dependent on one combobox
    By bigfoot007 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-10-2012, 01:01 PM
  7. Dependent Combobox on Form not updating from dynamic range
    By ron2k_1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-08-2011, 12:59 PM

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