Dim strDefaultPrinter As String
Dim strPrinterName As String
'Get current default printer.
strDefaultPrinter = Application.Printer.DeviceName
'When storing the Printer name be sure to include the full path and the Printer name, i.e. \\NetworkPath\PrinterName
strPrinterName = fncSetting(25)
'If *hardcoding* the Printer name then use the below.
'Note, this way defeats the purpose should the Printer name or location change.
'strPrinterName = "\\NetworkPath\Name of the Printer Goes Here"
'Switch to the other Printer
Set Application.Printer = Application.Printers(strPrinterName)
If Me.NewRecord Then
DoCmd.CancelEvent
Else
DoCmd.OpenReport "rptYoutReportNameGoesHere"
DoCmd.Close acReport, "rptYoutReportNameGoesHere", acSaveNo
End If
'Switch back to original Default Printer
Set Application.Printer = Application.Printers(strDefaultPrinter)