I'm sorry for asking such a simple question. I know the answer is so simple I just can't find it on the net and tired of looking for it. I'm using the commondialog in VB6 and when i hit cancel it still prints the page but it also brings up the error handler message so i know it's throwing the error. I just can't seem to get it to not print.

On Error GoTo cancel_error
If Text50.Text > "0" Then
priForm1.Show
priForm1.Text3.Text = Text51(0).Text
priForm1.Text4.Text = Text51(1).Text
priForm1.Hide
CommonDialog1.ShowPrinter
CommonDialog1.CancelError = True

priForm1.PrintForm
Unload priForm1
End If


cancel_error:
If Err.Number <> cdlCancel Then
MsgBox "Printing Canceled", vbOKOnly
End If


Thank you guys