473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 27031
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,834 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,556 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,556 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 mechanism is too complicated for the occasional...
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 | ---------- Customer/Product | -----------...
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 query. An example is as follows: SELECT 0 As...
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 duration. I would like to display 2 fileds of total...
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 names under properties "row source" "Phase 1"...
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 medium, if age is 10, update division to pee wee,...
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 having is with setting up a query. I have a Query...
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 setup like 'number' 'category' 'code' 'shares' and...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.