Hi, I have a problem with returning all records. The query gets its criteria from a user form. If the user leaves a field blank (Null) this means return all. The code I have uses an asterix as the criteria if the user enters nothing. However, to find all fields I need to use * OR IsNull otherwise Null value fields are not returned. The problem is I cannot get both from my statement. Its the IIF that I'm having trouble with. Here is the relevant part of the query:
(There are about half a dozen of these in my query. Some don't matter because the value is from a CBO on the form.)
Of course the alternative is to change all Null values in the table to zero length strings and set field default value to "".
Can anyone help. Garry. :-(
"If a job's worth doing, it's worth doing twice!"
Code:
Like IIf(IsNull([Forms]![frmCompaniesSelectionFilter]![TboZip]),"*",[Forms]![frmCompaniesSelectionFilter]![TboZip])
(There are about half a dozen of these in my query. Some don't matter because the value is from a CBO on the form.)
Of course the alternative is to change all Null values in the table to zero length strings and set field default value to "".
Can anyone help. Garry. :-(
"If a job's worth doing, it's worth doing twice!"