R
RipperT
I have a minor annoyance I'd like to get rid of. I have a button that opens
a report, but if no data is available, then the NoData event kicks in. I
found a nifty trick that cancels error messages with forms but it doesn't
work with this report:
Private Sub Report_NoData(Cancel As Integer)
On Err GoTo Err_Report_NoData
MsgBox " No data to display. ", vbOKOnly + vbExclamation, "No
Data"
Cancel = True
Exit_Report_NoData:
Exit Sub
Err_Report_NoData:
'if action is canceled by user, suppress error msg
Const conErrDoCmdCancelled = 2501
If (Err = conErrDoCmdCancelled) Then
Resume Exit_Report_NoData
End If
End Sub
After user clicks out of the custom msgbox, Access displays this one:
"The OpenReport Action was canceled."
Can I get rid of it?
Thanks,
Ripper
a report, but if no data is available, then the NoData event kicks in. I
found a nifty trick that cancels error messages with forms but it doesn't
work with this report:
Private Sub Report_NoData(Cancel As Integer)
On Err GoTo Err_Report_NoData
MsgBox " No data to display. ", vbOKOnly + vbExclamation, "No
Data"
Cancel = True
Exit_Report_NoData:
Exit Sub
Err_Report_NoData:
'if action is canceled by user, suppress error msg
Const conErrDoCmdCancelled = 2501
If (Err = conErrDoCmdCancelled) Then
Resume Exit_Report_NoData
End If
End Sub
After user clicks out of the custom msgbox, Access displays this one:
"The OpenReport Action was canceled."
Can I get rid of it?
Thanks,
Ripper