S
Seth
In the report OnNoData event I have the following code to display a message
if the report contains no data.
Private Sub Report_NoData(Cancel As Integer)
MsgBox "Your query did not return any data."
Cancel = True
End Sub
It works when I open the report manually but when I open the report with
code behind a form an error is generated.
The code behind my form is:
DoCmd.OpenReport "rptTestRprtsByModel", acViewPreview
The error is:
Error No: 2501; Description: The OpenRepoer action was canceled.
You used a method of the DoCmd object to carry out an action in Visual
basic, but then clicked cancel in a dialog box. Foe example, you used the
Close metnod to close a changed form, then clicked Cancel in the dialog box
that askes if you eant to save the changes you made to the form
How do I prevent this error?
Cheers,
Seth
if the report contains no data.
Private Sub Report_NoData(Cancel As Integer)
MsgBox "Your query did not return any data."
Cancel = True
End Sub
It works when I open the report manually but when I open the report with
code behind a form an error is generated.
The code behind my form is:
DoCmd.OpenReport "rptTestRprtsByModel", acViewPreview
The error is:
Error No: 2501; Description: The OpenRepoer action was canceled.
You used a method of the DoCmd object to carry out an action in Visual
basic, but then clicked cancel in a dialog box. Foe example, you used the
Close metnod to close a changed form, then clicked Cancel in the dialog box
that askes if you eant to save the changes you made to the form
How do I prevent this error?
Cheers,
Seth