n00b question. Query Criteria.

Ecron

Registered User.
Local time
Today, 12:55
Joined
Aug 31, 2006
Messages
58
Okay. So, this is my set up.

I have a form that has various input fields that are connected to my main table. What I want to do is have my form allow the user to enter information, leaving some of it blank if they don't want it, and then press a button and it will open the query with the arguements given. The problem i'm having is... when i leave a field blank, it doesn't pull up anything, but if i fill everything out then it's fine. Right now my criteria on my query sections just link directly to the combo boxes that i have created on the input forms. I believe i just have to have additional criteria, telling it to ignore null or something like that... but i'm not sure how! Please aide?

thanks!
 
Set up global variables to take the values held by the text boxes. Create a function to read each variable. If the variable is null, set the function equal to "*", otherwise set it to the value of the variable.

Set the query criteria for each field to:

Like Function()

It puts a wild card into any criteria that doesn't have a value. This worked very nicely on everything but multiple selection combo boxes. I was never able to get it to work with that.
 

Users who are viewing this thread

Back
Top Bottom