I have a report that is dynamically generated depending on the button pressed on my main form, in order to change the filter, the query used, etc. I have DoCmd.Rename
working to rename the report to the current (dynamic) report title. However, it appears that I cannot rename the report back to a generic name upon closing the report.
Using the Report_Close()
event doesn't work; Access tells me the report is still open and therefore can't be closed. Using DoCmd.Close
doesn't work either; I get Runtime error 2501 (The Close action was cancelled).
How can I rename this report after it's closed?