Choice of criteria selection / paremeter query

Mansoor Ahmad

Registered User.
Local time
Today, 23:00
Joined
Jan 20, 2003
Messages
140
Dear All

On a parameter query I have put three Text box references from a form on three different fields (CUSTOMER, LOT NO, MODEL). I want to have a search facility working like the following sentence

CUSTOMER and/or LOT NO and/or MODEL

What I have done is that I have put all the parameters in the same row of criteria of query. Now if on the form

I put a CUSTOMER in and leave the other two blank, it would return with nothing
I put CUSTOMER in and put asterisk (*) in other two, still brings nothing

It only works when all the fields are filled in.

I want to provide search facility with an option among the three parameters. Can somebody suggest something?
 
What kind of fields are you using on your form? Text or combo box/list box?
 
I am using Combo box/list box on the form.
 
OK. I assume you are referencing the form fields from the query using an expression like this:
Forms!formname!listboxname

The problem with that is if you don't make a choice from the listbox, then it's value is Null. Try using this as your criteria expression in your query:
Nz(Forms!formname!listboxname,"")
 

Users who are viewing this thread

Back
Top Bottom