@
mike60smart, adding on,
If you want the user to get a message when a report has no data, there are 2 places to possibly do it
- in the calling program
- in code behind the report
before DoCmd.OpenReport, perhaps you want to consider:
1. if report doesn't have any data, an error will be returned when Access tries to open it ... so maybe preface OpenReport with "On Error Resume Next", which will cause calling program to skip errors -- and then if an error happens, you can give a message that there wan't any data, or report couldn't be opened for some other reason -- unless what you opened already did that.
2. If report being opened has no data and has a NoData event, that will be executed, so opportunity to provide information to the user as to why no report is displayed.
@NoLongerSet suggests a generic procedure