Your technology certification is waiting. Enroll in Cloud Class ®
Public Sub PrintToSpecificPrinter(strPrinter As String)
'Created by Helen Feddema 12-Feb-2010
'Last modified by Helen Feddema 12-Feb-2010
On Error GoTo ErrorHandler
Dim strDefaultPrinter As String
'Save current default printer
strDefaultPrinter = Application.ActivePrinter
Debug.Print "Current default printer: " & strDefaultPrinter
'Select a specific printer as new default printer
Application.ActivePrinter = strPrinter
'Print the current document
'Set printer back to former default printer
Application.ActivePrinter = strDefaultPrinter
MsgBox "Error No: " & Err.Number & "; Description: " & _
Open in new window
This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.
Public Function ListPrinters()
'Lists Access printer names as used in VBA code
'to the Immediate window
Dim prt As Access.Printer
For Each prt In Application.Printers
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.