J
JohnE
I have a form that has a list box on it that lists all the reports. There is
a preview button on the form to preview the selected report. When the
preview button is used, that is when the parameter input is requested. It
all works fine so long as there is data to show. If there isn't any data, I
get the no data message then an error message coming from the code behind the
preview button. The code is below.
Private Sub btnReportsListingPreview_Click()
On Error GoTo btnReportsListingPreview_Click_Error
If Not IsNull(Me.lstReports) Then
DoCmd.OpenReport Me.lstReports, acViewPreview
DoCmd.RunCommand acCmdFitToWindow
End If
On Error GoTo 0
Exit Sub
btnReportsListingPreview_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
btnReportsListingPreview_Click of VBA Document Form_frmReportModule"
End Sub
What can I do to prevent this error message from occurring? Is there more
to add to the above?
Thanks... John
a preview button on the form to preview the selected report. When the
preview button is used, that is when the parameter input is requested. It
all works fine so long as there is data to show. If there isn't any data, I
get the no data message then an error message coming from the code behind the
preview button. The code is below.
Private Sub btnReportsListingPreview_Click()
On Error GoTo btnReportsListingPreview_Click_Error
If Not IsNull(Me.lstReports) Then
DoCmd.OpenReport Me.lstReports, acViewPreview
DoCmd.RunCommand acCmdFitToWindow
End If
On Error GoTo 0
Exit Sub
btnReportsListingPreview_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
btnReportsListingPreview_Click of VBA Document Form_frmReportModule"
End Sub
What can I do to prevent this error message from occurring? Is there more
to add to the above?
Thanks... John