Was the Previewed Report Printed

G

Guest

I have several reports that are to be printed with a single command.
I want to open the 1st report in preview mode to allow the user to select a
printer other that the default. If for some reason the user closes the
preview report without printing, I'd like to cancel the remainder of the
reports.

Is there a way to detect if the previewed report was actually printed or
cancelled?
 
F

fredg

I have several reports that are to be printed with a single command.
I want to open the 1st report in preview mode to allow the user to select a
printer other that the default. If for some reason the user closes the
preview report without printing, I'd like to cancel the remainder of the
reports.

Is there a way to detect if the previewed report was actually printed or
cancelled?

The actual starting value of intPreview depends upon if you have a
control in the report to compute [Pages].

Option Compare Database
Option Explicit
Dim intPreview As Integer

Private Sub Report_Activate()
intPreview = -1 ' If [Pages] is not used
' intPreview = -2 ' If [Pages] used
End Sub
================
Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As
Integer)
If intPreview >= 0 Then ' If [Pages] not used
' If intPreview >= 1 Then ' If [Pages] used
MsgBox "Report Printed"
End If
intPreview = intPreview + 1
End Sub
 
G

Guest

Thanks... That worked, but one more question.
How do I use the last printer selections (from the Print Dialog) for
subsequent reports?

fredg said:
I have several reports that are to be printed with a single command.
I want to open the 1st report in preview mode to allow the user to select a
printer other that the default. If for some reason the user closes the
preview report without printing, I'd like to cancel the remainder of the
reports.

Is there a way to detect if the previewed report was actually printed or
cancelled?

The actual starting value of intPreview depends upon if you have a
control in the report to compute [Pages].

Option Compare Database
Option Explicit
Dim intPreview As Integer

Private Sub Report_Activate()
intPreview = -1 ' If [Pages] is not used
' intPreview = -2 ' If [Pages] used
End Sub
================
Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As
Integer)
If intPreview >= 0 Then ' If [Pages] not used
' If intPreview >= 1 Then ' If [Pages] used
MsgBox "Report Printed"
End If
intPreview = intPreview + 1
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top