![]() |
#1
|
|||
|
|||
![]()
Based on my client's selection, I want to retrieve a Class Module ("clsRoster") object from the collection that corresponds to the client's choice without rolling through the entire collection ("colVendors" or "colClients") looking for a match. Entries in the relevant combobox are built from a subset of one of those collections.
Pretty basic. But I'm overwhelmed my search results for "Combo box", "value", "Column Bound" etc.. So please indulge my illiteracy. I have half-a-dozen word 2016 forms ("Partial Waiver", "Final Waiver", "Maintain Roster", "Notary", "Invoice" et. al.) combined into one project. Most of them share data from a "Roster.xlsx" Excel file that contains sheets entitled "Vendors" and "Clients". Because I am quite adept at locking up that excel file with my VBA testing, and because there are so few entries, I've opted to render those sheets into custom collections ("colClients", "colVendors"). I populated those collections with a class module ("clsRoster") built from each populated row of the appropriate spreadsheet. Depending on the form, the combobox I load (.additem) is a subset of the entries in the relevant collection. And then only the clsRoster.name field. Based on my client's selection, I want to populate a clsRoster object from the collection that corresponds to the client's combobox.listindex Again, the combobox entries are often a subset of the collection (e.g. clsRoster.name where clsRoster.IsActive = True) And though they will be ascending, they will not be consecutive. (e.g collection will have, say, records 1, 2, 3, 4, 5, 6 where as the combobox will have, say, records 2,3, 5) Most of the solutions I've devised are quite cumbersome. And, again, the Google search results are overwhelming. Last edited by grNadpa; 05-05-2022 at 10:19 AM. Reason: typos, grammar and clarification |
#2
|
|||
|
|||
![]()
Found my answer(s) in Greg Maxey's Populate Userform Listbox or Combobox
|
![]() |
Tags |
collections, vba combobox, word 2016 |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Time sheet entry selecting existing assignments using a custom hierarchy | TheOfficeGuy | Project | 1 | 08-23-2021 05:13 AM |
![]() |
kurt-hectic | Word | 4 | 03-21-2014 06:37 PM |
![]() |
mrbill | Word | 1 | 05-22-2013 10:25 PM |
Associate Outline Levels with Numbering | altjx | Word | 2 | 04-17-2012 02:06 PM |
![]() |
pm_newbie | Project | 5 | 12-20-2011 03:17 PM |