Reputation: 31
I need your help on MS Access 2007.
I have a big problem with my MS Access Unbound Form. How can I create a combo box i do not want bound to a table, show a multiple value List?
The Combo is named Sector and want these values to be selected in Multiples 9Which should be possible in Access 2007) from the Drop Down List: Fertilizer, Seeds, Pesticides, Veterinary products, Animal Feed, General.
Which Select Statement or VBA code can I use. I need a solution to handle this please.
Upvotes: 3
Views: 6899
Reputation: 1
Here is one way of doing what you want: Open up the table your Form will use. Then: Datasheet view, Datasheet Tab, Lookup Column. Select option: I will type in ... Next Under Col1 enter one of the user choices you want; for example A Dogs, then under that enter another choice; for example B Cats, etc Next give your lookup column label a name or stay with the default. Finally, Check Allow Multiple Values box. Finish. You now have a table with a combo box that allows the user to select 0, 1 or many choices. But you want it on a Form. Create Tab, Click Form. You now have a Form that has a multi value combobox. But you want it on a form you already created. Right click the ComboBox. Copy. Close the table and open the form you want the ComboBox to be a part of. Right click on a clean part of the form and Paste. Hope this is what you were looking for.
Upvotes: 0
Reputation: 14361
Precisely a ListBox control will help you. Since you are using it in MS Access - it makes it much easier with the wizard where you can type the items list. Or if you want to use VBA, then you can load the list using AddItem property of ListBox control in the Form_Load event.
Upvotes: 2