Using Multiple Selections From List Box

C

Carl Mankat

I am running A2K on a W2K machine.
I have not used list boxes much. I have used combo boxes to pass a value
to a query. I would like to use a multiple Selection list box and select
records from a table where the field selections in the list box match
those in the table. My objective is to select the records I want to
print as mailing labels.

Can I change this: Like [Forms]![tbl Access City]![Combo2] to
In[Forms]![tbl Access City]![Listboxo2] or something similar?
Am I correct in thinking that I can pass the list box selections to a
query assuming the form with the list box is still open?

If I am not on course so to speak, please redirect me.

TIA,

Carl
 
J

John Vinson

I would like to use a multiple Selection list box and select
records from a table where the field selections in the list box match
those in the table. My objective is to select the records I want to
print as mailing labels.

Your suggestion will work for a single-select listbox (just like using
a combo box) but not for a multiselect. For the latter you need a bit
of VBA code to loop through the Listbox's ItemsSelected collection and
build up a SQL string from scratch. For one example see:

http://www.mvps.org/access/forms/frm0007.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top