on nodate - runtime 438

teiben

Registered User.
Local time
Today, 22:26
Joined
Jun 20, 2002
Messages
462
I have a calendar control which opens a report PPAPCompleteRequests. If there are no records to display, on no data I have the following:

MsgBox "No records to display, try another date range!"
cancel = true

This works great, but now I have to print another report PPAPCompleteNONE. I added the following code, which works except for the runtime error. I'm guessing there is something not correct with my code OR do I try and hide the error?

This is what I have


Private Sub Report_NoData(Cancel As Integer)
MsgBox "No records to display, try another date range!"

DoCmd.OpenReport "PPAPCompleteNONE", acPreview
DoCmd.closereport "PPAPCompleteRequests"
Cancel = True

End Sub
 

Users who are viewing this thread

Back
Top Bottom