The code below switches printers and then prints a document to the printer. The Print succeeds but I get a error when trying to reset to the printer that was previously set.
Code:
Dim stDocName As String
Dim strDeviceName As String
Dim x$
' Get Current Printer Device and put it in temp
x$ = Application.Printer.DeviceName
' Select the alternate printer for this form
strDeviceName = "shop foreman printer"
Set Application.Printer = Application.Printers("shop foreman printer")
DoCmd.OpenReport "rptSalesOrderShopCopy", acNormal, , "[SalesOrderID]='" & Me.txtSalesOrderID & "'"
'Reset to default printer
strDeviceName = x$
Set Application.Printer = Application.Printers(strDeviceName)
Thoughts?