passing params to a query from a screen field..

B

Brad Pears

I need to make a change to an application where the user can select multiple
items from a list box and then pass the multiple items selcted in the form
of an "OR" clause to a specific field in a query..

Example is a listbox containing "Apples", "Oranges" and "Grapes". In the
past, the users criteria screen contained a combo box for the "FruitType"
field and the user could only pick ONE type of fruiit. In the query, I
simply user the syntax "forms![frmReportSelection].[cboListType]" for the
criteria and it worked just fine, listing all records where fruittype = the
selected combo box value.

So now, since I am changing the combo box to a list box and will be allowing
the user to select multiple records. When they are done selecting the items,
I will build the "criteria" clause to be used in the queries "criteria"
field within a form textbox (called txtCriteria) and then I should be able
to specify that textbox in the queries "criteria" field in the form like
this correct? =forms![frmReportSelection].[txtCriteria]"

If I am way off base or if there is a better way to pass multiple selections
to a query, please comment!

Thanks,

Brad
 

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