criteria in a combo box is picking up null values

S

sdgray

Hi, i am using the following code in a query to search for specific locations.

Like [Forms]![Mem2004]![Combo6] & "*"

This is working fine, in that its searching for the locations and also
searching for all when left blank. However, when i have a several of these in
the same query they are filtering out all the records because some are empty
values, and only the records that have an entry in every field appears.

Any idea how i can stop this happending, and so when you filter one it still
shows all the blanks in other fields?
 
T

Tom Ellison

Dear SD:

Please try it something like this:

WHERE (SomeColumn LIKE [Forms]![Mem2004]![Combo6] & "*"
OR Nz([Forms]![Mem2004]![Combo6], "") = "")

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Top