Query Criteria Error

niallmacmillan

New member
Local time
Today, 01:59
Joined
Sep 14, 2012
Messages
2
Hi All,

I have a form with 4 combo boxes so I can search a certain criteria.

I have research this and have been using this

[Forms]![Search]![Combo11] Or [Forms]![Search]![Combo11] Is Null

This work absolutely fine for a few times.

Then all of a sudden it got buggy and change all the criteria lines and looked horrible.

Please tell me there is something simple that I have done wrong!

Please see attachment images to understand.
 

Attachments

  • Query Criteria Error.PNG
    Query Criteria Error.PNG
    17.2 KB · Views: 158
  • Query Criteria Before Error.PNG
    Query Criteria Before Error.PNG
    13.9 KB · Views: 156
[Forms]![Search]![Combo11] Or [Forms]![Search]![Combo11] Is Null

First you have a combobox named combo11 which returns true or false. This is odd. A combobox is not supposed to do that. when your combobox returns 0 is means False anything else means True. Perhaps that is what you meant i don't know. It is an implicit way of coding. It is difficult to understand and the results might not be what you expect.

I would try to avoid testing for a NULL value. You better convert it using the Nz command.

Code:
Nz([Forms]![Search]![Combo11],"the value was null")

HTH:D
 

Users who are viewing this thread

Back
Top Bottom