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

Query to ignore form field

Status
Not open for further replies.

honeypot3

Instructor
Feb 8, 2005
77
GB
Hi there

I have a query which uses a form with two unbound fields on it to provide its selection criteria. This works fine when both fields are filled but if a user leaves a field blank because they want a wider search, the query returns no records at all. For example, if I want to find a labourer who earns £500-£700 - no problem but if I just want to find all labourers regardless of earnings (so leave earnings field blank) I get no records. Is there something you can use in an IIf function in the query to ignore the form field's reference?

Thanks Sandra
 
See faq701-3177

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
I have now had to extend the query above so it can also look at several Yes / No fields. Again I need these fields to be ignored if the user chooses not to select them. The Nz option shown previously for unbound text boxes does not seem to work here - i just get a blank query again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top