Set printer to unanmed default printer in access vba

Is it possible on a button click to ensure the printer used is always the one selected as default in the windows settings?

This may vary from computer to computer so i would like to avoid naming the printer, instead taking the name out of the windows defaults.

Using Access 2002-2012.

Thanks in advance.
Who is Participating?
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPConnect With a Mentor Commented:
To return the current default printer use this property:


Open in new window

? Application.Printer.DeviceName
Adobe PDF

Open in new window

I understand that i can set the printer but i want the vba code to seek out the name
I was suggesting NOT setting the printer to a named printer but set it to the default printer in the report page set up. This way it will automatically use the default printer.  I deploy front ends as MDE's and ACCDE's to 100's of different PCs. Every PC can have a different default printer using this method without any issues.   If I want to print a report to a specific printer I change Access's default printer not the report's.  This allows every user to define what printer they want to use as the default for Access with ever having to  change a  form/report design or the Window default printer!

Boyd Trimmell, Microsoft Access MVP
aka HiTechCoach
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPCommented:
To handle this I set my reports to use the default printer and have never had an issue. The key is to compile the front end into a MDE/ACCDE. This way any printer changes made by the user will not get saved.

Also see:
SweetingAAuthor Commented:
I understand that i can set the printer but i want the vba code to seek out the name of the listed default printer on whichever computer the user logs onto.

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.

All Courses

From novice to tech pro — start learning today.