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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I dont know how to ignore null fields on a search form...

Status
Not open for further replies.

joeconway

Technical User
Feb 19, 2007
4
GB
my problem is basically as the title suggests. I havea search form with multiple text boxes in, when I run the query i need it to check to see if the text box is empty and if not add it to the filtering criteria.

Any help would be much appreciated because I'm stumped
 
This:

[tt]If Trim(Me.[Name of textbox] & "")="" Then
'This text box is either spaces, a zero length string, or null[/tt]


Is quite a common way to check
 
alternatively:

If Nz(Me.[Name of textbox], "") = "" Then
'Does the same as above, but treats entries of all spaces as distinct and legitimate values
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top