Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with combo boxes

Status
Not open for further replies.

5835

Technical User
Jun 10, 2003
23
US
When I choose an item from combo drop down list it will allow only one sentence to pick up. Is there any way I can pick up multiple items from one combo box.
Thanx
 
Thanks for your input but I tried your method and it still won't let me populate the field with two or three items from a list.
 
You didn't say you wanted to populate a field with the selection (which is usually a bad idea - multiple values in a single field break any normalization rules)

But...just because it's possible:

For each itm in Me.ListBoxName.ItemsSelected
FieldName = FieldName & Me.ListBoxName.ItemData(itm) & ", "
Next

HTH


[pipe]
Daniel Vlas
Systems Consultant

 
Thanks again danvlas but i'm new to access and i'm not quite sure what this means "For each itm in Me.ListBoxName.ItemsSelected
FieldName = FieldName & Me.ListBoxName.ItemData(itm) & ", "
Next"
could you please explain what to do
Thanks
 
Hi,
Change the list box property MultiSelect to Extended
then
To select more than one item:
Click and Shift+Click for adjacent items.
Click and Ctrl+Click for non-adjacent items.

Hope this help
ZmrAbdulla
 
Thanks for your input ZmrAbdulla but this method didnt seem to work for me.
Thanks anyway
 
That's code...
Put a text box on the form (call it MyTextBox or whatever)
Put a command button on the form.
Right click the button and choose Build event - Code builder
Then paste the code where the cursor blinks

Dim itm
For each itm in Me.ListBoxName.ItemsSelected
Me.MyTextBox = Me.MyTextBox & Me.ListBoxName.ItemData(itm) & ", "
Next


Open the form, select a few items and click the button.
The text box will be populated with your selection, items separated by comma.

It's somehow advanced for your level of Access knowledge.
But it's simple for an intermediate user.

Time to do some digging in the Help files...

Good luck


[pipe]
Daniel Vlas
Systems Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top