moke123
AWF VIP
- Local time
- Yesterday, 21:47
- Joined
- Jan 11, 2013
- Messages
- 3,852
Cross Posted here ... https://www.accessforums.net/showthread.php?t=83096&p=472473#post472473
As noted in my cross post, I was toying around with a custom class for a picklist utilizing a dictionary object. I want to use a dictionary due to the fact that it is much easier to add and remove elements to it than other types of arrays or collections .(IMO anyway)
To use it only requires 2 lines of code in your form. One to instantiate the class and one to initiate the instance.
You only need to pass the 2 listbox objects to the class. Obviously you need a reference to Microsoft Scripting Runtime for the dictionaries.
In your selections listbox or left side listbox, set your column count and widths as well as your where clause and order by. The only requirement is
that the rowsource query is based on a table with the primary key in the first column.
The selected listbox or right side listbox does not need anything. Just drop it on your form. The settings from the left side listbox are automatically
transferred over.
I'm looking for any suggestions to improve it or to find out how you broke it.
As noted in my cross post, I was toying around with a custom class for a picklist utilizing a dictionary object. I want to use a dictionary due to the fact that it is much easier to add and remove elements to it than other types of arrays or collections .(IMO anyway)
To use it only requires 2 lines of code in your form. One to instantiate the class and one to initiate the instance.
You only need to pass the 2 listbox objects to the class. Obviously you need a reference to Microsoft Scripting Runtime for the dictionaries.
In your selections listbox or left side listbox, set your column count and widths as well as your where clause and order by. The only requirement is
that the rowsource query is based on a table with the primary key in the first column.
The selected listbox or right side listbox does not need anything. Just drop it on your form. The settings from the left side listbox are automatically
transferred over.
I'm looking for any suggestions to improve it or to find out how you broke it.