My previous post was meant to show you an error in your Dim statement.
You must explicitly dim your variables; else they re variant data type(default).
The last line
Code:
You're using a button --not sure what other event(s) you could use
was specific to your issue. You are using a button, what else (other than click) can/did you think you could do to make something happen?
Other events for command button
You could have a Form and have a calendar or a list of Dates to be used with your report.
You could select the appropriate date, then click a Make Report button that would
Open the Report and pass an Open argument (the Date) to the Report. (requires coding)
There is an example here.