J
JohnE
I am constructing this qry to show on a report. There are
2 optional fields, ClientName and OverallClientStatus. I
am having trouble with getting the correct AND/OR in
place. What I would like to do is:
1) if both fields are blank, all clients will be
displayed.
2) if client name is selected, only that client will
show regardless of the status
3) no client name selected but a status is, those
clients with that status will show.
The following is not working that way. Can anyone see
what is missing or is wrong?
SELECT ClientName, ClientCode, ClientStreetAddress1,
ClientStreetAddress2, ClientStreetAddressCity,
ClientStreetAddressState, ClientStreetAddressZipCode,
GeneralTelephone, GeneralFax, AccountManagement,
BusinessUnit, AccountManagementPerson,
OverallClientStatus, SalesPerson, EffectiveDate, Broker
FROM usrtblClientInformation
WHERE (((ClientName)=[Forms]![usrfrmReportModule]!
[cbxClientName]) OR
((OverallClientStatus)=[Forms]![usrfrmReportModule]!
[cbxOverallClientStatus])) OR
(([Forms]![usrfrmReportModule]![cbxOverallClientStatus])
Is Null) OR
((([Forms]![usrfrmReportModule]![cbxClientName]) Is Null));
Thanks for any assistance.
*** John
2 optional fields, ClientName and OverallClientStatus. I
am having trouble with getting the correct AND/OR in
place. What I would like to do is:
1) if both fields are blank, all clients will be
displayed.
2) if client name is selected, only that client will
show regardless of the status
3) no client name selected but a status is, those
clients with that status will show.
The following is not working that way. Can anyone see
what is missing or is wrong?
SELECT ClientName, ClientCode, ClientStreetAddress1,
ClientStreetAddress2, ClientStreetAddressCity,
ClientStreetAddressState, ClientStreetAddressZipCode,
GeneralTelephone, GeneralFax, AccountManagement,
BusinessUnit, AccountManagementPerson,
OverallClientStatus, SalesPerson, EffectiveDate, Broker
FROM usrtblClientInformation
WHERE (((ClientName)=[Forms]![usrfrmReportModule]!
[cbxClientName]) OR
((OverallClientStatus)=[Forms]![usrfrmReportModule]!
[cbxOverallClientStatus])) OR
(([Forms]![usrfrmReportModule]![cbxOverallClientStatus])
Is Null) OR
((([Forms]![usrfrmReportModule]![cbxClientName]) Is Null));
Thanks for any assistance.
*** John