I have a search form where users select criteria, which runs the query. e.g. Will return results of location 1 and location 2.
I want to make the And a variable so that the query can search either the above or location 1 OR location 2.
I have tried replacing the And in the query with the from control but Access doesn't like it. Can this be down any other way?
Select....
From....
WHERE (((forms!ServicesCombinedSearch!Location1)=services.location Or (forms!ServicesCombinedSearch!Location1) Is Null)
iif((forms!ServicesCombinedSearch!AndOr1)="Or","OR","AND")
((forms!ServicesCombinedSearch!Location2)=services1.location Or (forms!ServicesCombinedSearch!Location2) Is Null))
I want to make the And a variable so that the query can search either the above or location 1 OR location 2.
I have tried replacing the And in the query with the from control but Access doesn't like it. Can this be down any other way?
Select....
From....
WHERE (((forms!ServicesCombinedSearch!Location1)=services.location Or (forms!ServicesCombinedSearch!Location1) Is Null)
iif((forms!ServicesCombinedSearch!AndOr1)="Or","OR","AND")
((forms!ServicesCombinedSearch!Location2)=services1.location Or (forms!ServicesCombinedSearch!Location2) Is Null))