I am having trouble with the correct syntax for a multi-select problem.
I have a query driven by a form. The form allows users to search by client, which is abbreviated as "DIV." The DIV is a three-character abbreviation, consisting of letters and numbers. If a user wants records only for a particular client, they key in the 3-character code and the date range and run the query. If they want all clients, they leave the field blank, select the date range, then run the query.
Where I have a problem is if they want to run the query for TWO clients. Our client list is huge and always changing, so we don't have a combo box for the user to select from. Instead, we let them enter text. I have been unable to find a way to allow them to run more than one (but less than all) clients.
If the two client names were ABC and MNO, I had thought to have the user enter something like "ABC; MNO", but I couldn't figure out how to translate this to the query.
Here's a drastically reduced copy of the query (the driving form is "P_frmSummaryReport"):
We need the criteria at the end (graciously provided by PHP) to allow for null values and blank space values entered in the original records if we want the user to be able to truly view all records.
Any help is appreciated.
Thanks,
Paul
I have a query driven by a form. The form allows users to search by client, which is abbreviated as "DIV." The DIV is a three-character abbreviation, consisting of letters and numbers. If a user wants records only for a particular client, they key in the 3-character code and the date range and run the query. If they want all clients, they leave the field blank, select the date range, then run the query.
Where I have a problem is if they want to run the query for TWO clients. Our client list is huge and always changing, so we don't have a combo box for the user to select from. Instead, we let them enter text. I have been unable to find a way to allow them to run more than one (but less than all) clients.
If the two client names were ABC and MNO, I had thought to have the user enter something like "ABC; MNO", but I couldn't figure out how to translate this to the query.
Here's a drastically reduced copy of the query (the driving form is "P_frmSummaryReport"):
Code:
SELECT HF_DIV1573, agent, EvalDate, phone, Eval_id
WHERE (((HF_DIV1573) Like forms!P_frmSummaryReport!txtDIV) And ((EvalDate) Between forms!P_frmSummaryReport!txtFromDate2 And forms!P_frmSummaryReport!txtToDate2) And ((Left([Agent],2))<>"zz"))
Or (((EvalDate) Between forms!P_frmSummaryReport!txtFromDate2 And forms!P_frmSummaryReport!txtToDate2) And ((Left([Agent],2))<>"zz") And ((Trim(forms!P_frmSummaryReport!txtDIV & ""))=""))
ORDER BY agent DESC;
We need the criteria at the end (graciously provided by PHP) to allow for null values and blank space values entered in the original records if we want the user to be able to truly view all records.
Any help is appreciated.
Thanks,
Paul