Solved

in vba how do set the default printer?

Posted on 2000-02-25
1
363 Views
Last Modified: 2008-03-10
i am developing a form for colleagues to enable them to choose which report to print, the number of copies and on which printer.  Colleages do this by using a series of combo boxes listing the alternatives.

i can write code to select the report and number of copies but i don't know how to select the printer.  if possible i want this to be done automatically without the print dialogue box appearing.  however if the print dialogue box has to appear i can work with that.

thanks  clint9898
0
Comment
Question by:nigelrichards
1 Comment
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 50 total points
Comment Utility
Depends on how much control you want over the process.  You can simply popup the built in dialog and let the user choose, but it sounds like you want more then that.

In Access, to control the printer, you need to handle the PrtDevNames and PrtDevModes properties of the report.  Lot's of code has been published to handle this and I would suggest purchasing it in one way or another.  This is far cheaper and simpler then reinventing the wheel.

  The Access XX Developers Handbook published by Sybex is a good source for such code.  The print code is available on-line at:

http://www.microsoft.com/AccessDev/Articles/GetzCh10.html

  Another good source for print control code is:

http://ourworld.compuserve.com/homepages/attac-cg/

  ATTAC markets a product called "on the fly printing" and is well worth the price.  Check out the web site.

HTH,
Jim.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now