469,330 Members | 1,373 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,330 developers. It's quick & easy.

Multiple Criteria For a Single Query Field.

I built a select query filled with fields from multiple tables and queries. I have one field in this particluar query that will filter out a single order number. In the criteria box I put [What order number?] and that does the trick for filtering for one single record. What would the criteria syntax be if I wanted to filter for multiple order numbers? I'm thinking I will need as many as ten orders filtered for so I can create a report on them. I've read about this in a few other posts and found ways to do it that would involve me redesigning my db. If I have to rework it I will but I thought I'd ask you guys first.
Thanks,
James
Jan 18 '07 #1
6 26666
MSeda
159 Expert 100+
if you notice to the far left of the of the criteria boxes you'll see the word "Or". if you add and additional criteria in the box directly below it will search for either.
you could enter [What order number?] in the first row [2nd order number?] in the next row etc... for as many as you think may be neccesarry.However, the user will have to click through all of the parameter boxes even if they choose to enter only 1.
Jan 18 '07 #2
ADezii
8,800 Expert 8TB
I built a select query filled with fields from multiple tables and queries. I have one field in this particluar query that will filter out a single order number. In the criteria box I put [What order number?] and that does the trick for filtering for one single record. What would the criteria syntax be if I wanted to filter for multiple order numbers? I'm thinking I will need as many as ten orders filtered for so I can create a report on them. I've read about this in a few other posts and found ways to do it that would involve me redesigning my db. If I have to rework it I will but I thought I'd ask you guys first.
Thanks,
James
If you wish to Filter for a contiguous range then, in the Criteria Box:
Expand|Select|Wrap|Line Numbers
  1. Between [Enter Beginning Order ID] And [Enter Ending Order ID]
If the User enters 19 for the 1st prompt and 24 for the 2nd, it would return all Records with Order Numbers 19 through 24 inclusive. Hope this helps.
Jan 18 '07 #3
nico5038
3,080 Expert 2GB
In such a case I use an additional yes/no field in the table.
The multiple select will then be the setting of the field to Yes and the additional field is tested for that. When opening the form you can use a
currentdb.execute ("UPDATE tblX set YesNo = false")
to make sure all are off when the user starts.

Nic;o)
Jan 18 '07 #4
NeoPa
32,181 Expert Mod 16PB
For selecting a list of items use the In() statement :
Expand|Select|Wrap|Line Numbers
  1. WHERE [AccountNo] In('ABC','ABG','FDX','QBE')
Can be used with numeric or date entries as easily.
Jan 19 '07 #5
Nice stuff.
Thankyou.
Jan 23 '07 #6
NeoPa
32,181 Expert Mod 16PB
A pleasure. Glad to help.
Jan 23 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Beacher | last post: by
reply views Thread by Greg Strong | last post: by
1 post views Thread by Ivan Carey | last post: by
1 post views Thread by Barb.Richards | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.