Hi, I am creating a report in Access, where the users select checkboxes & they get the required data from table in the report. Below is the sql statement i have written:
The SQL query works perfect if we select/check e.g. one Option only..however if I select Option 1 & 2 both, it doesn't display records, whereas I have records for both the options my table. If I use OR operator in my SQL query, it displays all records of table, regardless of whether they were CHECKED or not . any help would be appreciated as I can't see how to configure it. Thks.
Code:
SELECT * FROM tblMain WHERE (((tblMain.[Column1]) LIKE[forms]![SearchReports]![Option1] & "*") AND ((tblMain.[Column2]) LIKE[forms]![SearchReports]![Option2] & "*") AND ((tblMain.[Column3]) LIKE[forms]![SearchReports]![Option3] & "*") AND ((tblMain.[Column4]) LIKE[forms]![SearchReports]![Option4] & "*"));
Comment