Hi All,
I have a search form named SV Search Menu, which includes the following fields:
Agency Number
Name
State
Rep
cboFederalBuilding
All of the fields are required for data entry except the cboFederalBuilding field. What I am trying to do is run a query using the search form criteria where if the cboFederalBuilding field on the search form is null the query will return all records satisfying the rest of the query criteria. However, if the cboFederalBuilding field on the search form is not null the query will use that value in conjunction with the rest of the query criteria. Here is what I have tried as cboFederalBuilding field query criteria:
IIf((IsNull([forms]![sv search menu]![cbofederalbuilding])),Like "*" Or Is Null,[Forms]![SV Search Menu]![cboFederalBuilding])
When I run the query I receive an error message stating that the query is too complex. Separately, these statements return what I am looking for, but they do not work together.
Any suggestions on what I am doing wrong?
Thank you,
Sandy
I have a search form named SV Search Menu, which includes the following fields:
Agency Number
Name
State
Rep
cboFederalBuilding
All of the fields are required for data entry except the cboFederalBuilding field. What I am trying to do is run a query using the search form criteria where if the cboFederalBuilding field on the search form is null the query will return all records satisfying the rest of the query criteria. However, if the cboFederalBuilding field on the search form is not null the query will use that value in conjunction with the rest of the query criteria. Here is what I have tried as cboFederalBuilding field query criteria:
IIf((IsNull([forms]![sv search menu]![cbofederalbuilding])),Like "*" Or Is Null,[Forms]![SV Search Menu]![cboFederalBuilding])
When I run the query I receive an error message stating that the query is too complex. Separately, these statements return what I am looking for, but they do not work together.
Any suggestions on what I am doing wrong?
Thank you,
Sandy