If you're using a command button to execute the query, then code on that button's click event would allow you to
- ensure both date controls have a valid date (or just aren't empty)
- ensure a choice has been selected for the scope of the report
- build the sql statement based on the choice
- ensure the report is not already open (otherwise it will simply become the active window without automatically refreshing the report)
- open the report based on that sql
I think that's the approach I would take, unless someone has a better one.
Edit
You'd have to create 2 WHERE portions for the 2 criteria options. I presume you get "all" now because I see no "active" or any other such criteria in the posted sql.
Last edited by Micron; 09-28-2018 at 03:43 PM.
Reason: spelin and gramur
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.