Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't cancel the print jobb of a Report in VB

Status
Not open for further replies.

hepe

Programmer
Feb 13, 2002
2
SE
If the user is click on the cancel button i the print window I dont no how I can catch that signal.

Private mReport As CRAXDRT.Report
Private rsReport As ADODB.Recordset

mReport.Database.SetDataSource rsReport
mReport.ReadRecords

mReport.PrinterSetup 0
mReport.Database.SetDataSource rsReport
 
Crystal has no way of knowing if the user presses the cancel button to stop the print job. There are a couple of ways around this...If you are using the common dialog control for print selection, you can set the cancelerror property to true and trap for the error.

If CrystalReport1.Destination = crptToPrinter Then
CommonDialog1.CancelError = True
On Error GoTo ErrButton
CommonDialog1.ShowPrinter
Screen.MousePointer = 1
endif


ErrButton:
MsgBox Err.Description
Screen.MousePointer = 1
End Sub

Otherwise, you can create your own printer selection form and force a cancel when activated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top