Passing parameter to a query from a form

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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>
 
Back
Top