Parameter help

C

cottage6

Hi everyone,
Pardon me if this question sounds dumb or makes no sense, but I'm a little
rusty using Access. I've been pressed into service to add a few parameters
to some queries and I'm stuck on one. I have a Banner field that can be P&C,
Quality, and a few other choices. I've got a select query that gets the
Banner, and I'd like the user to be able to specify which Banner she wants.
That part I know how to do, but I was wondering if there was a way to ask for
just one Banner or to ask for all Banners. Thanks for any help you can give!
 
J

Jeff Boyce

You didn't post the SQL statement your query is using, so the following is
somewhat unspecific...

If your query now has a parameter prompt something like:
[Enter Banner title]

you might be able to change that Selection Criterion to something like:
[Enter Banner title] or Is Null

Another approach would be to use a form and a combobox to allow the user to
pick from a list, then modify the query to point at the form to get its
criteria.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John Spencer

What I think Jeff meant to say was to enter the following as criteria

[Enter Banner title] or [Enter Banner title] Is Null

Access will rearrange that but it will still work unless you have a lot
of other fields you are trying to apply criteria to.

If the field you are applying the criteria to ALWAYS has a value (and is
text) then the following will also work.

Like IIF([Enter Banner Title] is Null,"*",[Enter Banner Title])

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================


Jeff said:
You didn't post the SQL statement your query is using, so the following is
somewhat unspecific...

If your query now has a parameter prompt something like:
[Enter Banner title]

you might be able to change that Selection Criterion to something like:
[Enter Banner title] or Is Null

Another approach would be to use a form and a combobox to allow the user to
pick from a list, then modify the query to point at the form to get its
criteria.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP

cottage6 said:
Hi everyone,
Pardon me if this question sounds dumb or makes no sense, but I'm a little
rusty using Access. I've been pressed into service to add a few
parameters
to some queries and I'm stuck on one. I have a Banner field that can be
P&C,
Quality, and a few other choices. I've got a select query that gets the
Banner, and I'd like the user to be able to specify which Banner she
wants.
That part I know how to do, but I was wondering if there was a way to ask
for
just one Banner or to ask for all Banners. Thanks for any help you can
give!
 
C

cottage6

Thanks to both Jeff and John for the solution to my question. Works like a
charm and makes perfect sense now that I see it. Thanks again!

John Spencer said:
What I think Jeff meant to say was to enter the following as criteria

[Enter Banner title] or [Enter Banner title] Is Null

Access will rearrange that but it will still work unless you have a lot
of other fields you are trying to apply criteria to.

If the field you are applying the criteria to ALWAYS has a value (and is
text) then the following will also work.

Like IIF([Enter Banner Title] is Null,"*",[Enter Banner Title])

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================


Jeff said:
You didn't post the SQL statement your query is using, so the following is
somewhat unspecific...

If your query now has a parameter prompt something like:
[Enter Banner title]

you might be able to change that Selection Criterion to something like:
[Enter Banner title] or Is Null

Another approach would be to use a form and a combobox to allow the user to
pick from a list, then modify the query to point at the form to get its
criteria.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP

cottage6 said:
Hi everyone,
Pardon me if this question sounds dumb or makes no sense, but I'm a little
rusty using Access. I've been pressed into service to add a few
parameters
to some queries and I'm stuck on one. I have a Banner field that can be
P&C,
Quality, and a few other choices. I've got a select query that gets the
Banner, and I'd like the user to be able to specify which Banner she
wants.
That part I know how to do, but I was wondering if there was a way to ask
for
just one Banner or to ask for all Banners. Thanks for any help you can
give!
 

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