473,624 Members | 2,027 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multimple User Input in Query using Criteria

Hi Gurus,

I have created simple query as

SELECT QUOTES.DATE, QUOTES.QUOTENO, QUOTES.SALESREP , QuoteItem.ITEM,
QUOTES.[JOB NAME], QUOTES.CUSTOMER , QUOTES.AMOUNT, QUOTES.[JOB NO],
QUOTES.Division ID, QUOTES.STATUS
FROM QUOTES INNER JOIN QuoteItem ON QUOTES.QUOTENO = QuoteItem.QUOTE NO
WHERE (((QUOTES.DATE) Between [enter the start date] And [enter the end
date]) AND ((QUOTES.SALESR EP)=[enter the SALESREP]) AND
((QuoteItem.ITE M)=[enter the ITEM]))
ORDER BY QuoteItem.ITEM;

Now what I want to do is when I run this query it should let me input
more than one ITEM so that when I want to get report for more than one
ITEM. For exaple I want to see report of three ITEMs it should ask me
in pop up box 3 times so that I can input and IF I input just one item
than it should give me report of one item (presently I am able to input
one ITEM and it works).

Thanks in advance.

Jan 17 '07 #1
3 4935
On 17 Jan 2007 13:12:55 -0800, mu************@ gmail.com wrote:

You could do something like this (using Northwind sample app):
SELECT Customers.*
FROM Customers
WHERE (((Customers.Cu stomerID)=[Give CustomerID1])) OR
(((Customers.Cu stomerID)=[Give CustomerID2]));

That's pretty ugly though. Much more elegant would be to use an IN
clause:
SELECT Customers.*
FROM Customers
WHERE (((Customers.Cu stomerID) IN ([Give CustomerIDs]));

Then you could enter as many comma-separated values as you wanted.
However, that doesn't work. MSFT is apparently unwilling to support
that. Next best thing is for you to compose this SQL string yourself,
and use it for your form or report.

Another suggestion is to use a form rather than all these popups. Then
for example the SalesRepID can come from a dropdown list of all
salesreps, and there is no chance of mistakes.

-Tom.
>Hi Gurus,

I have created simple query as

SELECT QUOTES.DATE, QUOTES.QUOTENO, QUOTES.SALESREP , QuoteItem.ITEM,
QUOTES.[JOB NAME], QUOTES.CUSTOMER , QUOTES.AMOUNT, QUOTES.[JOB NO],
QUOTES.Divisio nID, QUOTES.STATUS
FROM QUOTES INNER JOIN QuoteItem ON QUOTES.QUOTENO = QuoteItem.QUOTE NO
WHERE (((QUOTES.DATE) Between [enter the start date] And [enter the end
date]) AND ((QUOTES.SALESR EP)=[enter the SALESREP]) AND
((QuoteItem.IT EM)=[enter the ITEM]))
ORDER BY QuoteItem.ITEM;

Now what I want to do is when I run this query it should let me input
more than one ITEM so that when I want to get report for more than one
ITEM. For exaple I want to see report of three ITEMs it should ask me
in pop up box 3 times so that I can input and IF I input just one item
than it should give me report of one item (presently I am able to input
one ITEM and it works).

Thanks in advance.
Jan 18 '07 #2
Thanks Tom for oyur prompt response.

I am not expert in MS Access so I don't know how to create form for
report. So I just wish to get syntax for criteria which can let me
input more than one time. Can you palease guide me how can I make this
possible in following.

((QuoteItem.ITE M)=[enter the ITEM]))

Thanks

Tom van Stiphout wrote:
On 17 Jan 2007 13:12:55 -0800, mu************@ gmail.com wrote:

You could do something like this (using Northwind sample app):
SELECT Customers.*
FROM Customers
WHERE (((Customers.Cu stomerID)=[Give CustomerID1])) OR
(((Customers.Cu stomerID)=[Give CustomerID2]));

That's pretty ugly though. Much more elegant would be to use an IN
clause:
SELECT Customers.*
FROM Customers
WHERE (((Customers.Cu stomerID) IN ([Give CustomerIDs]));

Then you could enter as many comma-separated values as you wanted.
However, that doesn't work. MSFT is apparently unwilling to support
that. Next best thing is for you to compose this SQL string yourself,
and use it for your form or report.

Another suggestion is to use a form rather than all these popups. Then
for example the SalesRepID can come from a dropdown list of all
salesreps, and there is no chance of mistakes.

-Tom.
Hi Gurus,

I have created simple query as

SELECT QUOTES.DATE, QUOTES.QUOTENO, QUOTES.SALESREP , QuoteItem.ITEM,
QUOTES.[JOB NAME], QUOTES.CUSTOMER , QUOTES.AMOUNT, QUOTES.[JOB NO],
QUOTES.Division ID, QUOTES.STATUS
FROM QUOTES INNER JOIN QuoteItem ON QUOTES.QUOTENO = QuoteItem.QUOTE NO
WHERE (((QUOTES.DATE) Between [enter the start date] And [enter the end
date]) AND ((QUOTES.SALESR EP)=[enter the SALESREP]) AND
((QuoteItem.ITE M)=[enter the ITEM]))
ORDER BY QuoteItem.ITEM;

Now what I want to do is when I run this query it should let me input
more than one ITEM so that when I want to get report for more than one
ITEM. For exaple I want to see report of three ITEMs it should ask me
in pop up box 3 times so that I can input and IF I input just one item
than it should give me report of one item (presently I am able to input
one ITEM and it works).

Thanks in advance.
Jan 18 '07 #3
On 18 Jan 2007 06:52:53 -0800, mu************@ gmail.com wrote:

Isn't that what I did in my first suggestion: use an OR clause to
string several parts together. Perhaps this is clearer:
WHERE (((QUOTES.DATE) Between [enter the start date] And [enter the
end date]) AND ((QUOTES.SALESR EP)=[enter the SALESREP]) AND
(((QuoteItem.IT EM)=[enter first ITEM])) OR ((QuoteItem.ITE M)=[enter
second ITEM])))
etc.

-Tom.
>Thanks Tom for oyur prompt response.

I am not expert in MS Access so I don't know how to create form for
report. So I just wish to get syntax for criteria which can let me
input more than one time. Can you palease guide me how can I make this
possible in following.

((QuoteItem.IT EM)=[enter the ITEM]))

Thanks

Tom van Stiphout wrote:
>On 17 Jan 2007 13:12:55 -0800, mu************@ gmail.com wrote:

You could do something like this (using Northwind sample app):
SELECT Customers.*
FROM Customers
WHERE (((Customers.Cu stomerID)=[Give CustomerID1])) OR
(((Customers.C ustomerID)=[Give CustomerID2]));

That's pretty ugly though. Much more elegant would be to use an IN
clause:
SELECT Customers.*
FROM Customers
WHERE (((Customers.Cu stomerID) IN ([Give CustomerIDs]));

Then you could enter as many comma-separated values as you wanted.
However, that doesn't work. MSFT is apparently unwilling to support
that. Next best thing is for you to compose this SQL string yourself,
and use it for your form or report.

Another suggestion is to use a form rather than all these popups. Then
for example the SalesRepID can come from a dropdown list of all
salesreps, and there is no chance of mistakes.

-Tom.
>Hi Gurus,

I have created simple query as

SELECT QUOTES.DATE, QUOTES.QUOTENO, QUOTES.SALESREP , QuoteItem.ITEM,
QUOTES.[JOB NAME], QUOTES.CUSTOMER , QUOTES.AMOUNT, QUOTES.[JOB NO],
QUOTES.Divisio nID, QUOTES.STATUS
FROM QUOTES INNER JOIN QuoteItem ON QUOTES.QUOTENO = QuoteItem.QUOTE NO
WHERE (((QUOTES.DATE) Between [enter the start date] And [enter the end
date]) AND ((QUOTES.SALESR EP)=[enter the SALESREP]) AND
((QuoteItem.IT EM)=[enter the ITEM]))
ORDER BY QuoteItem.ITEM;

Now what I want to do is when I run this query it should let me input
more than one ITEM so that when I want to get report for more than one
ITEM. For exaple I want to see report of three ITEMs it should ask me
in pop up box 3 times so that I can input and IF I input just one item
than it should give me report of one item (presently I am able to input
one ITEM and it works).

Thanks in advance.
Jan 19 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2111
by: Brad | last post by:
I have an sql query that has specific criteria (like state='PA' or state = 'NJ'...) and would like to be able to have the user specify the criteria dynamically either through the web or from MSAccess or another tool. The query also does a GROUP BY the state and other variables that are part of the criteria. I know how to get MSAccess and asp pages to do the sorting and selecting against an SQL tbl or view, but when access queries the...
2
6866
by: Marius Kaizerman | last post by:
Hi, I have a report that is a based on a query. One of the fields in the query is "time of sale", which is a date field that holds the sales dates (day,month,year). I want to use that field as a month criteria in the query, so the report will print only records that holds a specific month in that field. How can I prompt the user to enter the month and pass it to the query ? Thanks!
2
5729
by: Mark Roughton | last post by:
I have a form where the users need to view records for various criteria, one of which is a date field on which they may wish to view all related data for the selected date, for all dates upto and icluding the selected date or all records on or after the selected date The user selects either "=", >=" or "<=" from a combo box and then a date from another combobox. The combination of thse two choices is then set in an unbound textbox so...
4
3503
waynetheengineer
by: waynetheengineer | last post by:
Hi, I was wondering if anyone had any suggestions on my database: I have a form that accepts user input into a single text box. When the OK button is hit, a query should search for all records that contain the user inputted text for a specific field in the query's criteria section. I want the criteria to search for any matching part of the word, for example: If the user enters in the text box: rabbit The query should return all...
7
4723
by: vaiism | last post by:
I am creating a report that outputs the contact information and details about a water treatment plant, and needs to include information about people who work there. If I tie all the information to a single query the report contains a full set of information for the plant for each of the people who work there. If I embed multiple queries into the report, the user has to input the search criteria once for each of the queries that is being...
0
1398
by: mmueller | last post by:
I am new to reporting services 2005 (reporting in Access for years and older versions of Reporting Services from time to time) and this is probably a dumb question... but I have no internal resources since I am the first to use it so... here you go: I have a report I am trying to recreate, the old one is in a PowerBuilder app and the author is no longer with company. The majority of the report is straightforward, but I am really hung up on...
2
3933
by: cmartin1986 | last post by:
First of all I want to thank all of you that have helped me in the past this is an awesome fourm. My problem today is I have a database that builds charts that are viewed by a large group every friday morning. I am building six different charts that all have query criteria of between two dates right now I am going and updating the charts manually every week. The dates these charts work on is always friday to thursday every week. Is there...
1
1426
by: Coll | last post by:
I have a database that produces different "cuts" of data for the user to export into excel. The database essentially opens queries using different criteria to filter the data as the user wants it. The user can then print or export to excel depending on the need. So I have a form that allows the user to specify how the data should be cut. I'm stumped on one aspect of this. I have a field called "Category" that has 10 possible values. None...
5
8108
by: Brett | last post by:
Hello, Is it possible to have just one criteria and have it apply to a group of queries? I am trying to create a report with the separate results of 4 queries based on a prompt for the user to input (only once) a date. Is this something that I program into the report? Also, this is related but may require a separate posting, but can I do
0
8236
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8173
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
8679
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
8621
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8335
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
4079
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
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2606
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
1
1785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.