By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,871 Members | 2,337 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,871 IT Pros & Developers. It's quick & easy.

Don't display the: "The OpenReport action was canceled" message box.

P: n/a
Hi,
For my 'On No Data' event I have the following code:

Private Sub Report_NoData(Cancel As Integer)
On Error Resume Next

MsgBox "There is no data available for your selections.", vbInformation,
"No Data Available..."
Cancel = True

End Sub
The code works fine but after the msgbox has been acknowledged, I get a
system message box stating "The OpenReport action was caceled". How do I
stop this from being displayed.

Version: AcessXP - database is in A2K format.

Thanks!!
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a


LittleCheeseburger wrote:
Hi,
For my 'On No Data' event I have the following code:

Private Sub Report_NoData(Cancel As Integer)
On Error Resume Next

MsgBox "There is no data available for your selections.", vbInformation,
"No Data Available..."
Cancel = True

End Sub

The code works fine but after the msgbox has been acknowledged, I get a
system message box stating "The OpenReport action was caceled". How do I
stop this from being displayed.

Version: AcessXP - database is in A2K format.

Thanks!!


Call your report with an OnError event

Sub CallReport()
On Error Goto Err_CallReport
Docmd.OpenReport "MyReport"

Exit_CallReport:
Exit Sub
Err_CallReport:
If err.number <> 2501 then msgbox err.description
resume Exit_CallReport
EndSub

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.