Two Criteria Questions - Need to be able to leave one blank

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to ask two criteria "input" questions.

Example:
1. What is your part number
2. What is your puchase order number

If I put both of the questions on the Criteria line I have to put data in
both input boxes. I want to give the person using this the flexablity, that
if he only knows the part number and not the purchase order to just put the
part number in and leave the purchase order number question blank (and
vis-vera). That way if the person knows the part number it will list all of
the purchase orders for that part number. I can make this happen if I put
the "What is your puchase order" question on the "Or" line. But then even if
you enter the purchase order it will bring up that part number plus all other
part numbers on that purchase order.

Thanks for your help!
 
On Thu, 17 Aug 2006 11:26:31 -0700, IR Scott <IR
I need to ask two criteria "input" questions.

Example:
1. What is your part number
2. What is your puchase order number

If I put both of the questions on the Criteria line I have to put data in
both input boxes. I want to give the person using this the flexablity, that
if he only knows the part number and not the purchase order to just put the
part number in and leave the purchase order number question blank (and
vis-vera). That way if the person knows the part number it will list all of
the purchase orders for that part number. I can make this happen if I put
the "What is your puchase order" question on the "Or" line. But then even if
you enter the purchase order it will bring up that part number plus all other
part numbers on that purchase order.

Thanks for your help!

Use two criteria, both on the same line:

[What is your part number] OR [What is your part number] IS NULL
[What is your purchase order number] OR [What is your purchase order
number] IS NULL

John W. Vinson[MVP]
 
Put the second criteria on the second row.

IR Scott said:
Karl:

I am fairly new with Access and I'm not sure what you mean by "command
button". I am entering a question (in []'s) under each file "Part Number"
and "Purchase Order". The questions are both on the "Criteria" row. (There
is a "Criteria" and an "Or" row). If I put both of the questions on the
"Criteria" line and leave one question blank it brings back no records.

Thanks!

KARL DEWEY said:
I assume you are using a command button. Then if the criteria is placed on
different rows in the query design view it will be an "OR" statement.
If you enter one only the other will be null and would only pull records
that have match your entry.
 
I tried that, that doesn't work either. That gives me the part number and
all of the purchase orders listed (even if I fill in the purchase order
question - with a purchase order). I want to be able to let them look up by
part number (and get all purchase orders), but if they know both purchase
order and part number then the can plug both of those values in and get only
that record. Thanks for you help!!

KARL DEWEY said:
Put the second criteria on the second row.

IR Scott said:
Karl:

I am fairly new with Access and I'm not sure what you mean by "command
button". I am entering a question (in []'s) under each file "Part Number"
and "Purchase Order". The questions are both on the "Criteria" row. (There
is a "Criteria" and an "Or" row). If I put both of the questions on the
"Criteria" line and leave one question blank it brings back no records.

Thanks!

KARL DEWEY said:
I assume you are using a command button. Then if the criteria is placed on
different rows in the query design view it will be an "OR" statement.
If you enter one only the other will be null and would only pull records
that have match your entry.

:

I need to ask two criteria "input" questions.

Example:
1. What is your part number
2. What is your puchase order number

If I put both of the questions on the Criteria line I have to put data in
both input boxes. I want to give the person using this the flexablity, that
if he only knows the part number and not the purchase order to just put the
part number in and leave the purchase order number question blank (and
vis-vera). That way if the person knows the part number it will list all of
the purchase orders for that part number. I can make this happen if I put
the "What is your puchase order" question on the "Or" line. But then even if
you enter the purchase order it will bring up that part number plus all other
part numbers on that purchase order.

Thanks for your help!
 
I assume you are using a command button. Then if the criteria is placed on
different rows in the query design view it will be an "OR" statement.
If you enter one only the other will be null and would only pull records
that have match your entry.
 
Karl:

I am fairly new with Access and I'm not sure what you mean by "command
button". I am entering a question (in []'s) under each file "Part Number"
and "Purchase Order". The questions are both on the "Criteria" row. (There
is a "Criteria" and an "Or" row). If I put both of the questions on the
"Criteria" line and leave one question blank it brings back no records.

Thanks!
 
Thanks to both of you!!! That answer came just in time... I am handing this
data base off first thing in the monring and that will make it much more
flexable!!!

Thanks again!
Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top