Solved

in vba how do set the default printer?

Posted on 2000-02-25
1
384 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

786 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