Big Pat
03-13-2008, 09:52 AM
Hi,
I’m very much an Access amateur and I don't follow much code, but I know enough to have put this into my report
Private Sub Report_NoData(Cancel As Integer)
MsgBox "No matching data for selected report."
DoCmd.CancelEvent
End Sub
... and this works OK.
But then I get another message saying "The OpenReport action was cancelled." Is there a way to turn this off? I tried
Private Sub Report_NoData(Cancel As Integer)
MsgBox "No matching data for selected report."
DoCmd.SetWarnings False
DoCmd.CancelEvent
DoCmd.SetWarnings True
End Sub
...but this seems to have no effect. I suppose that second message isn't a warning, but "information". Is there some code I can add in that will stop this second message?
Grateful for any pointers!
I’m very much an Access amateur and I don't follow much code, but I know enough to have put this into my report
Private Sub Report_NoData(Cancel As Integer)
MsgBox "No matching data for selected report."
DoCmd.CancelEvent
End Sub
... and this works OK.
But then I get another message saying "The OpenReport action was cancelled." Is there a way to turn this off? I tried
Private Sub Report_NoData(Cancel As Integer)
MsgBox "No matching data for selected report."
DoCmd.SetWarnings False
DoCmd.CancelEvent
DoCmd.SetWarnings True
End Sub
...but this seems to have no effect. I suppose that second message isn't a warning, but "information". Is there some code I can add in that will stop this second message?
Grateful for any pointers!