Prompt to see or not see blank report with No Data

R

RW

I've found code to prevent a blank report to display. However, now I need to
prompt the user as to whether they want to see the blank report (one manager
wants the blank report saved so all reports will be saved for a month and if
one isn't in the folder then it was not run). However, for most reports a
blank one does not need to be saved. I'm using the same report layout for
multiple reports. The Code below works but if a user selects 'Yes" then the
code runs a second time and prompts the user again. I only need 1 prompt.
Please help.

Thanks

Private Sub Report_NoData(Cancel As Integer)
Dim StrMsg As String
Dim StrTitle As String
StrMsg = "There isn't any data that matches the criteria you have selected."
& vbCrLf
StrMsg = StrMsg & "Would you like to see a blank report?"
StrTitle = "No Matches Found!"
Response = MsgBox(StrMsg, vbYesNo, StrTitle)
If Response = 6 Then
Cancel = False
Else
'Don't open the report
Cancel = True
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top