Hi all!
I recently designed a number of reports for a company to use as invoices. They run the invoices quarterly so there are 4 separate reports, 1 for each quarter. I wrote code for a button on a form which will run a specific report based on what month the button is clicked in (i.e. if it is clicked in April, the invoice for quarter 1 will be run). To do this I used IF logic:
If MonthName(Month(Date))="April" Then
DoCmd.OpenReport "Quarter1"
And so on. I know that the switch function is better to use than ifs, but I'm not sure how to write what I have above into a switch function, or if it is possible. Any help is appreciated!
Thanks in advance.
I recently designed a number of reports for a company to use as invoices. They run the invoices quarterly so there are 4 separate reports, 1 for each quarter. I wrote code for a button on a form which will run a specific report based on what month the button is clicked in (i.e. if it is clicked in April, the invoice for quarter 1 will be run). To do this I used IF logic:
If MonthName(Month(Date))="April" Then
DoCmd.OpenReport "Quarter1"
And so on. I know that the switch function is better to use than ifs, but I'm not sure how to write what I have above into a switch function, or if it is possible. Any help is appreciated!
Thanks in advance.