Two multi-select list boxes

G

Guest

Hi Allen

I found this post and this is exactly what I need. I just have a question
since I'm just a new Access user and I can't write codes very well... Will
the code change since I have 5 columns instead of 2 (as in your sample using
the Northwind Database) and no Number columns, all are Text. I copied your
codes and the report is showing the query and not the results of the query
based on the list box... Hopefully you can help me. Thanks.

_____

Yes, you can read data from 2 unbound multi-select list boxes, to make up
the WhereCondition for the OpenReport action.

In the end, the WhereCondition string will look something like this:
"([Category] IN (""dog"", ""cat"")) AND ([SomeID] IN (1,4,7))"

For the steps to get there, see:
Use a multi-select list box to filter a report
at:
http://members.iinet.net.au/~allenbrowne/ser-50.html
 
A

Allen Browne

The number of columns in the list box makes no difference, since it only
looks at the bound column.

If the bound column is a Text type field (not a Number type field), you need
to remove the single quote from the start of this line near the top of the
procedure:
'strDelim = """" 'Delimiter appropriate to field type. See
note 1.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Freeda said:
Hi Allen

I found this post and this is exactly what I need. I just have a question
since I'm just a new Access user and I can't write codes very well... Will
the code change since I have 5 columns instead of 2 (as in your sample
using
the Northwind Database) and no Number columns, all are Text. I copied
your
codes and the report is showing the query and not the results of the query
based on the list box... Hopefully you can help me. Thanks.

_____

Yes, you can read data from 2 unbound multi-select list boxes, to make up
the WhereCondition for the OpenReport action.

In the end, the WhereCondition string will look something like this:
"([Category] IN (""dog"", ""cat"")) AND ([SomeID] IN (1,4,7))"

For the steps to get there, see:
Use a multi-select list box to filter a report
at:
http://members.iinet.net.au/~allenbrowne/ser-50.html

siric said:
Could I use two multi-select list boxes for a report prepared by the
conditions of two fields of selected items ?

Best Regards
 

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