I’m working on a fire department Run database for the local volunteer fire department. They will log their daily run sheets into the database then query it via a form.
With a few online tutorials I’ve managed to get a simple query by form to work for exact matches, but that’s not all I need. The form launches a macro that I believe launches the query. Odd to need a 3rd Party system (the macro) but it seems to work.
Database has a field called ‘Shifts’ currently populated with either “A-Shift” or “B-Shift” or “C-Shift” or Null (records with Null will be populated to show proper shift at a later date).
Form has a combo-box called Shifts with “All”;”A-Shift”;”B-Shift”;”C-Shift” as the values. Naturally with either of the shifts selected it returns a report correctly but how do I get it to show all records when “All” is selected?
The criteria in the query currently is: [Forms]![FormName]![Shift]
I tried using an Immediate If statement (IIF) but it returned that it was too complicated and halted.
I thought about trying to do a if then statement in the form before the values were sent like so:
[Shift] = “All”
[Shift] = “A-Shift” OR “B-Shift” OR “C-Shift” OR NULL
But don’t know enough about expressions or VBA to do it.