473,508 Members | 2,477 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.DivisionID, QUOTES.STATUS
FROM QUOTES INNER JOIN QuoteItem ON QUOTES.QUOTENO = QuoteItem.QUOTENO
WHERE (((QUOTES.DATE) Between [enter the start date] And [enter the end
date]) AND ((QUOTES.SALESREP)=[enter the SALESREP]) AND
((QuoteItem.ITEM)=[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 4925
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.CustomerID)=[Give CustomerID1])) OR
(((Customers.CustomerID)=[Give CustomerID2]));

That's pretty ugly though. Much more elegant would be to use an IN
clause:
SELECT Customers.*
FROM Customers
WHERE (((Customers.CustomerID) 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.DivisionID, QUOTES.STATUS
FROM QUOTES INNER JOIN QuoteItem ON QUOTES.QUOTENO = QuoteItem.QUOTENO
WHERE (((QUOTES.DATE) Between [enter the start date] And [enter the end
date]) AND ((QUOTES.SALESREP)=[enter the SALESREP]) AND
((QuoteItem.ITEM)=[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.ITEM)=[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.CustomerID)=[Give CustomerID1])) OR
(((Customers.CustomerID)=[Give CustomerID2]));

That's pretty ugly though. Much more elegant would be to use an IN
clause:
SELECT Customers.*
FROM Customers
WHERE (((Customers.CustomerID) 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.DivisionID, QUOTES.STATUS
FROM QUOTES INNER JOIN QuoteItem ON QUOTES.QUOTENO = QuoteItem.QUOTENO
WHERE (((QUOTES.DATE) Between [enter the start date] And [enter the end
date]) AND ((QUOTES.SALESREP)=[enter the SALESREP]) AND
((QuoteItem.ITEM)=[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.SALESREP)=[enter the SALESREP]) AND
(((QuoteItem.ITEM)=[enter first ITEM])) OR ((QuoteItem.ITEM)=[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.ITEM)=[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.CustomerID)=[Give CustomerID1])) OR
(((Customers.CustomerID)=[Give CustomerID2]));

That's pretty ugly though. Much more elegant would be to use an IN
clause:
SELECT Customers.*
FROM Customers
WHERE (((Customers.CustomerID) 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.DivisionID, QUOTES.STATUS
FROM QUOTES INNER JOIN QuoteItem ON QUOTES.QUOTENO = QuoteItem.QUOTENO
WHERE (((QUOTES.DATE) Between [enter the start date] And [enter the end
date]) AND ((QUOTES.SALESREP)=[enter the SALESREP]) AND
((QuoteItem.ITEM)=[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
2109
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...
2
6856
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...
2
5725
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...
4
3487
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...
7
4719
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...
0
1389
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...
2
3917
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...
1
1420
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....
5
8082
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...
0
7231
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,...
0
7133
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
7336
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,...
0
7405
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...
0
7504
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...
1
5059
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...
0
4724
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...
0
3214
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...
1
773
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.