Items not showing up on Query?

S

shcram

I wrote a simple query to our DB to list animals that are residing i
our shelter. I pull animal's name, sex, registration number, neutered
and name and address of the person who brought the animal to us (al
unique fields on our DB).

My query wasn't giving me enough records, and I finally discovered tha
if no name & address was typed in (for example, the animal was abandone
at our gate and we don't know who left it there) the query skips th
entire record!

How can I make my query display all records, whether some fields hav
no data or not? I can't find an answer in my reference books and I'v
been tinkering with this for several weeks.

Thanks,
Su
 
S

Someone

You need to include allowances for Nulls. In the criteria field, of each
column, you need to include the following (adjusted to your form and field
names).

[Forms]![Form_Name]![Field_Name] Or [Forms]![Form_Name]![Field_Name] Is
Null)

You could amend the above to include 'Like', which allows users to enter
part of the field name and return matching records.

Like "*" & [Forms]![Form_Name]![Field_Name] & "*" Or
[Forms]![Form_Name]![Field_Name] Is Null)

M
 
R

Randy Harris

Sue,

It might be tough to help without seeing your query. Can you post the SQL?
If you go into query builder, change the View from design to SQL view,
you'll see the underlying SQL.

Randy
 
Top