Discussion Locked

Display Message on report when no data

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I need a method, macro, VBA code that can be placed in a report that displays a line of text on a report when there is no data brought back to the report by a table or query as the data source. I do not want to display a message to the screen. I need the text to print on the report.

Thanks
Ldufresne19

4 replies

by timfox

As you are printing the report...
The report event NoData will run when a report is prepared for printing. This happens when the report is sent to a printer or shown to the user in print preview. Place a text box with the text "Sorry, your query has not produced any data records" on your report. Ensure the text box's Visible property is set to "No". In the On No Data event handler set the text box's visible property to True. Just remember to close the report with the SaveNo option, so the textbox will then only be visible for no data.

I had the same problem last week - Hope this helps.

This discussion is closed to new replies.