Query wont pull up a blank field

Ydrasil72683

Registered User.
Local time
Today, 18:11
Joined
Jul 16, 2012
Messages
14
Hello
I am running a query with Like "*" & [forms]![Frm_Lock_DES]![LNumber] & "*" in the Criteria field. This links it to the form which returns all the records that have all values in them, For example 1st name,last name, email etc. But if a record has a blank field it will not return anything, I just get a blank table. Is there a way to do this with a Where clause ? I have been experimenting Is Null and the Where Clause but I cant get the Syntax right. Does anybody have any suggestions ?
 
Now as well I have enter in the OR underneath Criteria Where fieldname Is Null and it doesnt return any values
 
I would try entering all your criteria on the criteria line instead of on the OR line. This way the query will automatically write the correct SQL statement to ensure the OR Is Null criteria applies in every combination of choices made on your form. An example from a query of mine is:
in criteria row [Forms]![ClosedByType]![CboLine] OR [Forms]![ClosedByType]![CboLine] Is Null
all on the same line. after the query is saved and run [Forms]![ClosedByType]![CboLine] is placed on several lines and Is Null is placed in other places. I suggest putting all criteria on the same line.
 
Like robina hinted:
Code:
Like "*" & [Forms]![Frm_Lock_DES]![LNumber] & "*" OR [Forms]![Frm_Lock_DES]![LNumber] Is Null
Copy and paste into the same box where your current code resides.
 

Users who are viewing this thread

Back
Top Bottom