A
Abby
I want to put code in the Event Procedure of my Print
Record command button that will change the printer from
the current printer to a specific printer, print the
record and then switch the printer back to the original
printer. I found the following code:
Sub SwitchPrinter()
Dim strActivePrinter as String
strActivePrinter = Application.ActivePrinter
Application.ActivePrinter = " .... " ' I put the full name
of printer I want to use (including the path)
ActiveDocument.PrintOut
Application.ActivePrinter = strActivePrinter
End Sub
I also have code from Word which I have used in a macro to
print to a specific printer:
Dim currPrinter as string
currPrinter = ActivePrinter
ActivePrinter = "\\RPFS1\West"
ActiveDocument.PrintOut
ActivePrinter = currPrinter
End Sub
And of course the code that the PrintRecord has already in
it:
Private Sub cmdPrintRecord_Click()
On Error GoTo Err_cmdPrintRecord_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, ,
acMenuVer70
DoCmd.PrintOut acSelection
Exit_cmdPrintRecord_Click:
Exit Sub
Err_cmdPrintRecord_Click:
MsgBox Err.Description
Resume Exit_cmdPrintRecord_Click
End Sub
How do I create the code (from these pieces) to accomplish
my goal?
Thank you.
Record command button that will change the printer from
the current printer to a specific printer, print the
record and then switch the printer back to the original
printer. I found the following code:
Sub SwitchPrinter()
Dim strActivePrinter as String
strActivePrinter = Application.ActivePrinter
Application.ActivePrinter = " .... " ' I put the full name
of printer I want to use (including the path)
ActiveDocument.PrintOut
Application.ActivePrinter = strActivePrinter
End Sub
I also have code from Word which I have used in a macro to
print to a specific printer:
Dim currPrinter as string
currPrinter = ActivePrinter
ActivePrinter = "\\RPFS1\West"
ActiveDocument.PrintOut
ActivePrinter = currPrinter
End Sub
And of course the code that the PrintRecord has already in
it:
Private Sub cmdPrintRecord_Click()
On Error GoTo Err_cmdPrintRecord_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, ,
acMenuVer70
DoCmd.PrintOut acSelection
Exit_cmdPrintRecord_Click:
Exit Sub
Err_cmdPrintRecord_Click:
MsgBox Err.Description
Resume Exit_cmdPrintRecord_Click
End Sub
How do I create the code (from these pieces) to accomplish
my goal?
Thank you.