Null values in multiple search criteria query based on form

R

Richard Flaaten

I have a form which contains two unbound text boxes in
which to enter a last name and a first name. This data is
used by a query to search for records in a table.

Some of the records in the table contain no first name,
thus, has Null values.

Using Like "*" & formLastName & "*"
and Like "*" & formFirstName & "*"

Works fine for all records but the ones with null values.
I found a 'workaround' on the web which told me to
type "Or Is Null" after the Like-sentence.

While this works, it creates a problem: when searching
only for a first name, the query always returns every
record that has a Null value.


Any thoughts on how to fix this? I tried using Iif
(formFirstName = "";Null;) as criteria for the first name
field, but that didn't work.



Thanks,
Richard
 

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