scamquist58
Technical User
I am trying to change the default printer when an Access form loads.
The following code works:
Private Sub Form_Load()
Dim prtDefault As Printer
Set Application.Printer = Application.Printers(7)
Set prtDefault = Application.Printer
End Sub
However, I want to specify the printer name.
DEVICE NAME: \\PP-FP01\Office Cannon iR-ADV C3230i UFR II
DRIVER NAME: winspool
PORT: 192.168.0.25
Any ideas on how to use device name or port or whatever to accomplish this?
Thank you in advance.
When the form closes, it reverts back to the default using:
Private Sub Form_Unload(Cancel As Integer)
'~~>To restore the Printer object, to the Windows default
'~~> Tis destroys the object. MS Access then reconstructs it - from the default Windows printer.
Set Application.Printer = Nothing
End Sub
The following code works:
Private Sub Form_Load()
Dim prtDefault As Printer
Set Application.Printer = Application.Printers(7)
Set prtDefault = Application.Printer
End Sub
However, I want to specify the printer name.
DEVICE NAME: \\PP-FP01\Office Cannon iR-ADV C3230i UFR II
DRIVER NAME: winspool
PORT: 192.168.0.25
Any ideas on how to use device name or port or whatever to accomplish this?
Thank you in advance.
When the form closes, it reverts back to the default using:
Private Sub Form_Unload(Cancel As Integer)
'~~>To restore the Printer object, to the Windows default
'~~> Tis destroys the object. MS Access then reconstructs it - from the default Windows printer.
Set Application.Printer = Nothing
End Sub