Null Parameters in Query

  • Thread starter Thread starter lmgedling
  • Start date Start date
L

lmgedling

Guest
I have three combo boxes on a form, which are used as parameters on the same query. I'd like the option to leave all or some of these boxes blank, and the query would then return all records for the blank parameter(s), but still take into account what has been selected on the other two boxes, if anything.

I'm a relative beginner to Access, and although I've read through the archive of questions on this forum, I still don't seem to be able to figure it out. I've tried adding [Forms]![fname]![Combo1] Is Null to the Or line on the query design page, but that just returns to records at all.

Would appreciate any help!

Many thanks,
Lindsay
 
when i was trying to work out how to use a query and there wasn't a value (nz function) that means you need to use the nz function.
 
when i was trying to work out how to use a query and there wasn't a value (nz function) that means you need to use the nz function.
 
To use the nz function, by the way,

IIf(NZ([Fieldname])=Null,0,[Fieldname])
 
that isn't how i used it.



i used like
nz([fieldname],0)+nz([fieldname],0)
 
Actually the Nz function is not required here, it's a combination of Is Not Null Or Is Null.
As for the Nz function just Nz([Field]) will do, you only need the 0 if you want to use field in a calculation.
 
I just use a checkbox on the side and disable the combo when the user wants to select the whole list or no item in the list.
 

Users who are viewing this thread

Back
Top Bottom