Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

searching for a null value

Status
Not open for further replies.

FontanaS

Programmer
May 1, 2001
357
0
0
US
I have a question,

If I am writing the recordsource for a report and am searching a table for a value based on a value:

If the user leaves a text box blank, then I want to find a record that has that same text box blank in the table.

Will it work since both values are null?

I am not sure how searching for a null using a null will effect the recordset.

Now when I try it doesn't even recognize the null value and just says that it can't find the record.

Ex - I am displaying to the user five text boxes for them to put criteria in that I will then search the table by.
The user might leave only one text box blank because four of them are required. (called doc char) In the table are the same rules. Only one text box might be blank (called doc char)

Thanks
 
I think a construct like:

If IsNull(<textbox>) then
select ...... where <appropriate attribute> Is Null;

should work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top