472,325 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,325 software developers and data experts.

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 26876
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,832 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,511 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,511 Expert Mod 16PB
A pleasure. Glad to help.
Jan 23 '07 #7

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

Similar topics

6
by: Ralph2 | last post by:
Some time ago with a lot of help from this group I made a reasonably successful database to keep track of our shop drawings. However the searching...
5
by: Beacher | last post by:
I've noticed that you can only have a sub datasheet pointing to one table... is there anyway to change this? for example I have Customer |...
0
by: Greg Strong | last post by:
Hello All, In the past I've used a combo box with the 'row source' being an Access SQL union query to select "All" or 1 for only 1 criteria in a...
1
by: Ivan Carey | last post by:
How can a query display multiple fields with diferent condition on the same field example I have a field name of reason and a field name of...
3
by: hmiller | last post by:
Hey everyone, I am having a hell of a time trying to set this menu system up. Here's what I'm trying to do. Combo Box One; is populated by...
1
by: davidevan | last post by:
What I'm trying to do is set a players division according to their age. So if age is 8, update division to junior, if age is 9, update division to...
10
by: FNA access | last post by:
Hello to the world of the wise, I am a CSOM student at TRU. I am trying to design a database to improve my understanding. The problem I am...
1
by: Barb.Richards | last post by:
I have created an append query that pulls information from one database, and will append the selected information into a new table. The fields are...
4
by: jvan2008 | last post by:
"Form1" combobox "cboModel" Row Source SELECT ., . FROM tblModel ORDER BY ; combobox "cboContactName" SELECT . FROM Query1 ORDER BY ;
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.