Very strange
I am having no luck in surpressing "The OpenReport action was canceled" message when a report finds no data to display! I put code in the NoData event to display a user message and then cancel the event. Like this:
Private Sub Report_NoData(Cancel As Integer)
DoCmd.SetWarnings False
MsgBox "No data found for selected options! Closing report."
Cancel = True
End Sub
Just to be carefule
I set DoCmd.SetWarnings True on the report close event. I thought the DoCmd.SetWarnings would prevent the "action canceled" message but it doesn't? I even tried putting the DoCmd line on the line right before the DoCmd.OpenReport line in form which run the report. Still no luck. Any ideas on this? BTW, this is Access 97.
Thanks - Dabits
I am having no luck in surpressing "The OpenReport action was canceled" message when a report finds no data to display! I put code in the NoData event to display a user message and then cancel the event. Like this:
Private Sub Report_NoData(Cancel As Integer)
DoCmd.SetWarnings False
MsgBox "No data found for selected options! Closing report."
Cancel = True
End Sub
Just to be carefule
Thanks - Dabits