Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-05-2022, 10:09 AM
grNadpa grNadpa is offline Best way to associate combobox entry to source custom collection Windows 10 Best way to associate combobox entry to source custom collection Office 2016
Advanced Beginner
Best way to associate combobox entry to source custom collection
 
Join Date: Mar 2022
Posts: 46
grNadpa is on a distinguished road
Default Best way to associate combobox entry to source custom collection

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
Reply With Quote
  #2  
Old 05-05-2022, 12:43 PM
grNadpa grNadpa is offline Best way to associate combobox entry to source custom collection Windows 10 Best way to associate combobox entry to source custom collection Office 2016
Advanced Beginner
Best way to associate combobox entry to source custom collection
 
Join Date: Mar 2022
Posts: 46
grNadpa is on a distinguished road
Default

Found my answer(s) in Greg Maxey's Populate Userform Listbox or Combobox
Reply With Quote
Reply

Tags
collections, vba combobox, word 2016



Similar Threads
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
Best way to associate combobox entry to source custom collection associate metadata to sections of text kurt-hectic Word 4 03-21-2014 06:37 PM
Best way to associate combobox entry to source custom collection .doc will not associate with Office 2010 mrbill Word 1 05-22-2013 10:25 PM
Associate Outline Levels with Numbering altjx Word 2 04-17-2012 02:06 PM
Best way to associate combobox entry to source custom collection associate mpp files with Project 2010 Options pm_newbie Project 5 12-20-2011 03:17 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:43 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft