Change Printers

Hi,

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.

Tx
sonmicAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jeffrey CoachmanMIS LiasonCommented:
?
Meaning if you click the Print Icon and see the print dialog box, you cannot change the printer...?
0
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.
0
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
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jeffrey CoachmanMIS LiasonCommented:
ok

Glad I could help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.