creating a string with multiple entries for query parameter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have a simple form where user chooses between 'option A' which is five
different job numbers pre-programmed into a string or 'option B' which is a
combo box with thousands of job numbers to make one selection. If 'A' then
it needs to fill in a hidden text box with a string that a saved query will
use as a parameter. Getting the string to work is the problem. A example is
below:

string as it might show in text box: """00112""" & "OR " & """00612"""
query parameter field: [forms]![frm_LPFJB]![selection]
 
i have a simple form where user chooses between 'option A' which is five
different job numbers pre-programmed into a string or 'option B' which is a
combo box with thousands of job numbers to make one selection. If 'A' then
it needs to fill in a hidden text box with a string that a saved query will
use as a parameter. Getting the string to work is the problem. A example is
below:

string as it might show in text box: """00112""" & "OR " & """00612"""
query parameter field: [forms]![frm_LPFJB]![selection]

Parameter queries only accept values - not operators such as OR.

You'll need to build up the SQL statement in code rather than using a
parameter query. I'd suggest using the In() clause:

.... WHERE [JobNumber] IN("00112", "00612")...

would be the eventual target.

John W. Vinson[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

Back
Top