Passing parameter to a query from a form

G

Guest

I have a form with an extended multi-selection list box and I would like to use the selected fields into two queries as criteria. Is there any way to do it. What I have done so far is to get a textbox in my form with the criteria. the queries are used as a subequery for a report.

listbox My criteria will be IN ("xxx","zzz")
XXX ----> selected
YYY
ZZZ ----> selected

Thanks
 
J

Jeff Boyce

Fred

Not sure I understand...

You have (potentially) multiple values selected in a listbox, and want to
have a query use all selected as a criterion? I'm not familiar with a way
to "code into a query", as your post seems to request.

One approach would be to create code behind your form that dynamically
builds a SQL statement, including the selected items, then runs that SQL.

Good luck!

Jeff Boyce
<Access MVP>
 

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