B
Bill
Hi, I have two problems for Preview Button and Print Button.
1) Preview Button: When I select and preview and got no report and click
"Ok". I got the message saying "The openreport action was canceled". Is
there a way to avoid that message.
2) Print Button: When I select a report and got the message "No report"
and click "OK" but it trying to print something while showing Print is
running from Page 1 to 3. That is it. I don't want to show the print
dialog message if there is no report.
Here is the code if I miss anything based on #1 and #2.
**********************************************
Private Sub Report_NoData(Cancel As Integer)
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
strMsg = "There are no records for the report"
intStyle = vbOKOnly
strTitle = "No Data for Date Range"
MsgBox strMsg, intStyle, strTitle
Cancel = True
End Sub
**********************************************
Your help would be much appreciated.
1) Preview Button: When I select and preview and got no report and click
"Ok". I got the message saying "The openreport action was canceled". Is
there a way to avoid that message.
2) Print Button: When I select a report and got the message "No report"
and click "OK" but it trying to print something while showing Print is
running from Page 1 to 3. That is it. I don't want to show the print
dialog message if there is no report.
Here is the code if I miss anything based on #1 and #2.
**********************************************
Private Sub Report_NoData(Cancel As Integer)
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
strMsg = "There are no records for the report"
intStyle = vbOKOnly
strTitle = "No Data for Date Range"
MsgBox strMsg, intStyle, strTitle
Cancel = True
End Sub
**********************************************
Your help would be much appreciated.