"If the user enters something, return something, otherwise return everything"

  • Thread starter Thread starter Chris Mortimore
  • Start date Start date
C

Chris Mortimore

I need a expression for a query thinger. The database
has 4 possible values for a field called "Voltage", these
values are 11, 33, 0 or NULL (NULL being actually
nothing, not the word "NULL"). I want a query that will
ask the user for an input and if they enter something
(say, 33), it will show whatever they ask for (like all
the 33s), otherwise show everything. I can get it to
filter everything OK (to just show my 33s and such like),
however the problem I am having is when the user enters
nothing, as the records that have a NULL voltage are not
being shown. Any ideas anyone?

Sorry if this makes no sense, this has been bugging me
for hours and I'm a smudge stressed.

Thanks,

Chris
 
Set it up as follows.

Field: Voltage
Criteria: [Enter Voltage] OR [Enter Voltage] is Null

When you save this, Access will restructure it so the next time you open it, it
will look different but it should still work. Be warned that this technique
will fail if there are too many criteria in the query.
 
Fantastic, thank you muchly :) Tis working perfectly now,
hence I can get paid this month.
-----Original Message-----
Set it up as follows.

Field: Voltage
Criteria: [Enter Voltage] OR [Enter Voltage] is Null

When you save this, Access will restructure it so the next time you open it, it
will look different but it should still work. Be warned that this technique
will fail if there are too many criteria in the query.

Chris said:
I need a expression for a query thinger. The database
has 4 possible values for a field called "Voltage", these
values are 11, 33, 0 or NULL (NULL being actually
nothing, not the word "NULL"). I want a query that will
ask the user for an input and if they enter something
(say, 33), it will show whatever they ask for (like all
the 33s), otherwise show everything. I can get it to
filter everything OK (to just show my 33s and such like),
however the problem I am having is when the user enters
nothing, as the records that have a NULL voltage are not
being shown. Any ideas anyone?

Sorry if this makes no sense, this has been bugging me
for hours and I'm a smudge stressed.

Thanks,

Chris
.
 
Back
Top