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.
SweetingAAsked:
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.

Boyd (HiTechCoach) Trimmell, Microsoft Access MVPDesigner and DeveloperCommented:
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:
http://office.microsoft.com/en-us/access-help/changing-printer-settings-for-a-report-in-access-HA001034553.aspx

http://allenbrowne.com/AppPrintMgt.html
0
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.

Regards
0
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPDesigner and DeveloperCommented:
To return the current default printer use this property:

Application.Printer.DeviceName

Open in new window


example:
? 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
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
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.