I have a form that is used to select date parameters. When I click OK these are turned into a filter for a report and then DoCmd.OpenReport is fired. If there is no data I was getting an error message for the report so I inserted an On No Data event into the report to give a message saying there is no data then cancel the report opening. This creates an error in the original OnClick event in the form. Error 2501 Open report was cancelled. How do I back out of the DoCmd.OpenReport if there is no data?
I’ll give you more info if this is unclear. I suspect it is simple but the old brain isn’t up to it right now.