By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

combo to list box

P: 5
Currently i have a combo box that lets a user select a persons name and print a mailing label for it. I now need to be able to select multiple names and print labels for them. I tried changeing the combo box to a list box with a simple multi select, but when i push the button for the report it is telling me there are no labels for mailing (meaning it is not registering any data). the label report is linked to the form, meaning the memberid from the form is the criteria for the report. what do i need to do to make this possible. is it true that a multiselect box wont work for this...and if it is true, how can i accomplish it?

many thanks
caleb
Aug 21 '06 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
You need to use a For Each statement to run through the selections in the listbox.

Dim iSelect as Variant

For Each iSelect In Me.Listxxx.ItemsSelected
'Your code here
'Remember the memberid value of each selection will be referred to
'as Me.Listxxx.ItemData(iSelect)
'Example
Docmd.OpenReport "MailingLabel", , , "[MemberID]=" & Me.Listxxx.ItemData(iSelect)
Next iSelect

Currently i have a combo box that lets a user select a persons name and print a mailing label for it. I now need to be able to select multiple names and print labels for them. I tried changeing the combo box to a list box with a simple multi select, but when i push the button for the report it is telling me there are no labels for mailing (meaning it is not registering any data). the label report is linked to the form, meaning the memberid from the form is the criteria for the report. what do i need to do to make this possible. is it true that a multiselect box wont work for this...and if it is true, how can i accomplish it?

many thanks
caleb
Aug 21 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.