Cancel a report in progress!!

  • Thread starter Thread starter Scott Trowbridge
  • Start date Start date
S

Scott Trowbridge

In VB I'm trying to cancel a report that is in progress if we find an error.
So as an example, in the OPEN section we read a system file, etc. and
realize we have a problem that effects the printing of the report and we
need to terminate. I've tried:

Private Sub Report_NoData(Cancel As Integer)
MsgBox "No records to report", _
vbOKOnly + vbInformation, _
"No Matching Records"
Cancel = True
End Sub

but find that after this Sub('Report_NoData') is run it bounces back to the
Sub that originally calls it when the error was detected and DOES NOT
terminate the report.

Any ideas?

Scott
 
AFIK, once report has started printing, you can not programatically stop
it. If your printer has enough memory, the entire report has been sent to
the printer's memory. If your printer does not have enough memory, the
report is spooled to memory on your harddrive. All you can do is turn off
the printer.
 
Back
Top