G
Guest
I am running into a problem. Sometimes the following procedure will run and
stop half way through (MS Access 2002 w/ the latest SP's just locks up and
stops responding). When it does that it leaves the strSlipPrinter as the
deafault printer and does not change back to the strCurrentPtr (the current
default printer). Is there a way to ensure that the current default printer
is changed back once the procedure completes or fails? There are other
programs that use the default printer for reports. When it stays on the
label printer (strSlipPrinter), the reports print out on labels. This is no
good!
-------start of code----------
Dim strCurrentPtr As String
Dim strSlipPrinter As String
strSlipPrinter = DLookup("[Printer]", "[DefaultLabelPrinter]", "[ID]
= 1")
strCurrentPtr = GetDefaultPrinter
SetDefaultPrinter strSlipPrinter
DoCmd.OpenReport "PackageSlip", acViewNormal
DoCmd.OpenReport "MailboxSlip", acViewNormal
SetDefaultPrinter strCurrentPtr
------------------end of code-----------------
stop half way through (MS Access 2002 w/ the latest SP's just locks up and
stops responding). When it does that it leaves the strSlipPrinter as the
deafault printer and does not change back to the strCurrentPtr (the current
default printer). Is there a way to ensure that the current default printer
is changed back once the procedure completes or fails? There are other
programs that use the default printer for reports. When it stays on the
label printer (strSlipPrinter), the reports print out on labels. This is no
good!
-------start of code----------
Dim strCurrentPtr As String
Dim strSlipPrinter As String
strSlipPrinter = DLookup("[Printer]", "[DefaultLabelPrinter]", "[ID]
= 1")
strCurrentPtr = GetDefaultPrinter
SetDefaultPrinter strSlipPrinter
DoCmd.OpenReport "PackageSlip", acViewNormal
DoCmd.OpenReport "MailboxSlip", acViewNormal
SetDefaultPrinter strCurrentPtr
------------------end of code-----------------