Queries and Null values

Banelight

Registered User.
Local time
Today, 20:03
Joined
Dec 2, 2013
Messages
13
Hi All,

I have a query running on my database built within a form that has 2 drop down boxes to stipulate search criteria, ie: Status and Make.

The query works perfectly fine, as long as both fields are filled in. What i would like is if one of the fields is left blank, the query should return all results of the other criteria.

After googling, I found this suggestion :
=Forms!yourform.combobox OR Forms!yourform.combobox Is Null

However when I try add the second part, it keeps complaining about syntax or missing operator.

What am I doing wrong?
 
Where are you trying to add this statement? If VBA, show the entire code. If QBE, then you should add it one below the other.. The Criteria First line should say.. Forms!yourform.combobox and the Next line on the same column should say Forms!yourform.combobox Is Null
 
Thank you! They never specified the"Next line" part in the other post!
I have added it to second criteria and it works...!

Thanks!
 
You can write it in the same line, not a problem. Although you need to be careful with how you do it. As you start using Access frequently you will understand how to place the conditions.

Glad to help, Good Luck !
 

Users who are viewing this thread

Back
Top Bottom