G
Guest
Scenario.
I have reports generator form, which basically consists of a list box of
reports, and two command buttons, one to open the report in preview mode and
the other to close the reports form. What I am finding is that when I select
a report to open, it also, automatically displays the Print Dialog box, which
I don't want.
Here is my Code that actually runs the report, when the designated button is
clicked.
Private Sub cmdOpenReport_Click()
' Purpose: Opens the report selected in the list box.
On Error GoTo cmdOpenReport_ClickErr
If Not IsNull(Me.QCReports) Then
DoCmd.OpenReport Me.QCReports, IIf(Me.chkPreview.Value, acPreview,
acViewNormal)
End If
Exit Sub
cmdOpenReport_ClickErr:
Select Case Err.Number
Case 2501 'Cancelled by User, or by NoData Event.
MsgBox "Report Cancelled, or no matcing data.", vbInformation,
"Information"
Case Else
MsgBox "Error " & Err & ": " & Error$, vbInformation,
"cmdOpenReport_Click()"
End Select
Resume Next
End Sub
I have reports generator form, which basically consists of a list box of
reports, and two command buttons, one to open the report in preview mode and
the other to close the reports form. What I am finding is that when I select
a report to open, it also, automatically displays the Print Dialog box, which
I don't want.
Here is my Code that actually runs the report, when the designated button is
clicked.
Private Sub cmdOpenReport_Click()
' Purpose: Opens the report selected in the list box.
On Error GoTo cmdOpenReport_ClickErr
If Not IsNull(Me.QCReports) Then
DoCmd.OpenReport Me.QCReports, IIf(Me.chkPreview.Value, acPreview,
acViewNormal)
End If
Exit Sub
cmdOpenReport_ClickErr:
Select Case Err.Number
Case 2501 'Cancelled by User, or by NoData Event.
MsgBox "Report Cancelled, or no matcing data.", vbInformation,
"Information"
Case Else
MsgBox "Error " & Err & ": " & Error$, vbInformation,
"cmdOpenReport_Click()"
End Select
Resume Next
End Sub