I have a table with a field called job
. I have a form with an option button. If the option button is not selected, I want to return all rows. However, if the option button is selected, I want to return all rows that do not begin with "RWK". How can I achieve this?
This should do it:
SELECT * FROM myTable
WHERE Forms!myForm!myOptionButton.Value = 0
OR job NOT LIKE 'RWK*'
Boolean logic. If the option button is off, the WHERE clause is always true.