• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

Change Printers


I have a database where sometimes i have to print to a PDFcreator. I t works fine, but i can't set back the default printer.

  • 3
1 Solution
Jeffrey CoachmanMIS LiasonCommented:
Meaning if you click the Print Icon and see the print dialog box, you cannot change the printer...?
sonmicAuthor Commented:
No, i change the printer in the VBA. I store the default printer in a variable but i can't set it back on the end of the procedure.
Jeffrey CoachmanMIS LiasonCommented:
Post the code you are using to print form PDF
What version of Access are you running?

This is the standard code to set the default printer:

Public Declare Function SetDefaultPrinter Lib "winspool.drv" Alias "SetDefaultPrinterA" (ByVal pszPrinter As String) As Long

Private Sub SetDefPrntr()
    SetDefaultPrinter YourDeviceName
End Sub
Jeffrey CoachmanMIS LiasonCommented:

Glad I could help
Question has a verified solution.

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.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now