IIf Is Null query criteria

shutzy

Registered User.
Local time
Today, 12:42
Joined
Sep 14, 2011
Messages
775
i would like a list box to show all the records when the form opens but the combo box that is part of the criteria is blank when the form opens so nothing shows. ive tried an IIf but it dosnt seem to work. can anyone help with this

IIf(IsNull([Forms]![frmAppointmentTreatmentItems]![comboTreatmentFilter]),"",[Forms]![frmAppointmentTreatmentItems]![comboTreatmentFilter])
 
fantastico. thanks for your help. i thought that Is Null had to be followed by ().

can i ask how the query knows to show all the items when combo Is Null. it dosnt make sense to me. it works but i cant understand why.
 
The query selects the record if the field value = the criteria value or the criteria value is null, since the criteria value will be null for every record all records will be selected.

Brian
 
thanks pat. its useful to know as i am learning this on the fly.

There is no reason to force the SQL engine to invoke the VBA library unnecessarily.

would this slow the process down?
 

Users who are viewing this thread

Back
Top Bottom