I use Lebans ConvertReportToPDF module to produce PDF's of my reports and would like to tidy up the process when there is no data in the report.
I use a button on a form to start the process
The report has NoData coding
and the ConvertReportToPDF is Leban's standard module.
The problem is when there is no data I get:
A message box which says "printing now outputting..." then another MsgBox "There are currently no records available for this report." which then stops the process until I click OK and then the 1st 2 boxes disappear and I get another message box saying "The OutputTo Action was cancelled" and I have to again click OK. There is no error code on this last message box.
Does anyone know how I can stop the 1st and last message box just to be left with "There are currently no records available for this report."
Thanks in advance for any suggestions or help.
I use a button on a form to start the process
Code:
Private Sub CmdReporttoPDFNoPreview_Click()
' Save the Report as a PDF document but with no preview.
Dim blRet As Boolean
blRet = ConvertReportToPDF(Me.[ReportName], vbNullString, _
"" & Me.[SaveAs] & ".pdf", False, False, 150, "", "", 0, 0, 0)
End Sub
The report has NoData coding
Code:
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There are currently no records available for this report."
Cancel = True
If Err = 2501 Then Err.Clear
End Sub
and the ConvertReportToPDF is Leban's standard module.
The problem is when there is no data I get:
A message box which says "printing now outputting..." then another MsgBox "There are currently no records available for this report." which then stops the process until I click OK and then the 1st 2 boxes disappear and I get another message box saying "The OutputTo Action was cancelled" and I have to again click OK. There is no error code on this last message box.
Does anyone know how I can stop the 1st and last message box just to be left with "There are currently no records available for this report."
Thanks in advance for any suggestions or help.