Parameter help

  • Thread starter Thread starter cottage6
  • Start date Start date
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!
 
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
 
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!
 
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!
 
Back
Top