query criterion management

A

AccessMan

I am trying to use a parameter query to narrow query results. On the
criteria line I have entered [Enter field criterion:] which prompts the user
for a value.

However, I would like the criterion to be treated as "Is Not Null" when the
user does not enter anything for the parameter, i.e., when they just hit
enter. Using Like "*"&[Enter field criterion:]&"*" accomplishes this, but it
also can return more results than what I want. When a query parameter is
entered, I want an exact match. When nothing is entered I want all results.

I've tried fooling with temporary variables, but can't get it to work. Any
ideas? Thanks!
 
G

Guest

AccessMan said:
I am trying to use a parameter query to narrow query results. On the
criteria line I have entered [Enter field criterion:] which prompts the
user
for a value.

However, I would like the criterion to be treated as "Is Not Null" when
the
user does not enter anything for the parameter, i.e., when they just hit
enter. Using Like "*"&[Enter field criterion:]&"*" accomplishes this, but
it
also can return more results than what I want. When a query parameter is
entered, I want an exact match. When nothing is entered I want all
results.

I've tried fooling with temporary variables, but can't get it to work.
Any
ideas? Thanks!

Use the following as your criteria:

[Enter field criterion:] Or [Enter field criterion:] Is Null

John
 
A

AccessMan

John:

This worked perfectly! Thanks!

So getting the criteria to evaluate to true in the event of a null response
is what I needed to do? This was not obvious to me beforehand.


AccessMan said:
I am trying to use a parameter query to narrow query results. On the
criteria line I have entered [Enter field criterion:] which prompts the
user
for a value.

However, I would like the criterion to be treated as "Is Not Null" when
the
user does not enter anything for the parameter, i.e., when they just hit
enter. Using Like "*"&[Enter field criterion:]&"*" accomplishes this, but
it
also can return more results than what I want. When a query parameter is
entered, I want an exact match. When nothing is entered I want all
results.

I've tried fooling with temporary variables, but can't get it to work.
Any
ideas? Thanks!

Use the following as your criteria:

[Enter field criterion:] Or [Enter field criterion:] Is Null

John
 

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

Top