Solved

in vba how do set the default printer?

Posted on 2000-02-25
1
397 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
ID: 2557925
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

680 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