mitchem1
Registered User.
- Local time
- Today, 01:59
- Joined
- Feb 21, 2002
- Messages
- 153
I have a query that is the source behind a Search form (frmFindProject). The form contains 5 unbound combo boxes: cboContractNumber, cboCounty, cboRoute, cboEngineer, and cboImprovement Type. The idea is for the user to retrieve records from a project table based on what is entered in the combos. For example, if the user enters nothing at all, all records should be retrieved. The criteria fields in the query look similar to this:
IIf([Forms]![frmFindProject]![ContractNumber] Is Null,[tblProject]![ContractNumber],[Forms]![frmFindProject]![cboContractNumber])
IIf([Forms]![frmFindProject]![cboCounty] Is Null,[tblProject]![CountyID],[Forms]![frmFindProject]![cboCounty])
and so on....
It works great, unless a record contains a null value in one of these columns. Then the record is not retrieved. I want to return all records, even those that contain nulls. Any advice would be greatly appreciated.
IIf([Forms]![frmFindProject]![ContractNumber] Is Null,[tblProject]![ContractNumber],[Forms]![frmFindProject]![cboContractNumber])
IIf([Forms]![frmFindProject]![cboCounty] Is Null,[tblProject]![CountyID],[Forms]![frmFindProject]![cboCounty])
and so on....
It works great, unless a record contains a null value in one of these columns. Then the record is not retrieved. I want to return all records, even those that contain nulls. Any advice would be greatly appreciated.