473,663 Members | 2,838 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple Criteria For a Single Query Field.

76 New Member
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 27061
MSeda
159 Recognized Expert New Member
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.Howe ver, 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 Recognized Expert Expert
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 Recognized Expert Specialist
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.execu te ("UPDATE tblX set YesNo = false")
to make sure all are off when the user starts.

Nic;o)
Jan 18 '07 #4
NeoPa
32,568 Recognized Expert Moderator MVP
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
kcddoorman
76 New Member
Nice stuff.
Thankyou.
Jan 23 '07 #6
NeoPa
32,568 Recognized Expert Moderator MVP
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
4619
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 user and I would like to change the whole process. I would like to duplicate the layout of my form... but each field becomes a simple "searching" ListBox. On completing any one search field all the rest are filtered to this value. Subsequent...
5
5662
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 | ----------- Customer Grp/Sales Grp
0
2463
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 PvdrID, "All" As PvdrDesc FROM tblPrvdr UNION SELECT PvdrID, PvdrDesc FROM tblPrvdr ORDER BY PvdrID; In the query I would place a field which wasn't selected for display which was
1
1800
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 duration but each have different reasion criteria. display Total Recall based on a calculation that adds the total duration for each record that has a criteria of RC on the same query display Total Shift based upon a calculation that adds the
3
3649
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" through "Phase 10" (there are 10 Phases I want to sort from) Once the phase has been selected a second combo box would populate.
1
1970
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, and etc. I'm trying to accomplish this in a single query, and be able to run this query and verify that players are in the right division. Is it possible to update multiple records in a table with a single query while having criteria?
10
10138
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 Form that has multilple controls to narrow the results of the query. The functionality I am looking for is to allow a user to enter text into each of the textboxes or into couple or into none. Each textbox corresponds to a field in a Table. ...
1
2843
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 'dollars'. Using the "backend" of this table I can filter the numbers by right clicking and using Filter For: then enter 1 or 2 or 3 and this will return results for all information that has 1 or 2 or 3 as a number. However, the problem I...
4
3499
by: jvan2008 | last post by:
"Form1" combobox "cboModel" Row Source SELECT ., . FROM tblModel ORDER BY ; combobox "cboContactName" SELECT . FROM Query1 ORDER BY ;
0
8345
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8858
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8634
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7371
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5657
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4182
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.