Printing to different printers in Access Basic

Hi,
I'm using Access 2000 to generate some reports. I need (within an Access module) to programmatically print each report to a series of different printers (none of which is potentially the machine's default printer). The names of the different printers I'm retrieving from the database. I've seen several articles talking about the "Prtdevnames" property but cannot find any good examples. I know within VB this must be possible - can anyone help ?
gngAsked:
Who is Participating?
 
TrygveConnect With a Mentor Commented:
MIDA: What if gng does not have that book?

gng: Have you looked on the info and article links that I posted?
0
 
TrygveCommented:
Link to article: http://www.mvps.org/access/reports/rpt0009.htm


"Change printers from code"


In order to change printer information, you must use APIs.

The PrtDevNames property stores the name of the printer, and the PrtDevMode property stores the driver information. Both of these properties need to be changed in order to change the printer driver. If the PrtDevMode property does not match the PrtDevNames property (that is, the PrtDevMode property describes a different driver than the PrtDevNames property) a General Protection (GP) Fault may occur.

Visit these links for more details and solutions.


"How to Change a Report's Printer Using Code (MS KB)" - http://support.microsoft.com/support/kb/articles/q129/3/97.asp

"Chapter 10:   Controlling your printer (MS KB)" - http://www.microsoft.com/AccessDev/Articles/GetzCh10.HTM

"Download the code (DefaultPrt.zip) from here (Courtesy of Ken Getz)." - http://www.mcwtech.com/Downloads.htm

or, if you need ready code to pop into your application,

"On The Fly Printing (ATTAC Group)" - http://ourworld.compuserve.com/homepages/attac-cg/acgsoft.htm
0
 
MIDACommented:
Go to chapter 7 of Access 20000 developper handbook, volume 1, getz, Litwin, Gilbert, Sybex edition.
0
 
gngAuthor Commented:
Thanks ! - the Ken Getz link was just what was needed !
0
 
TrygveCommented:
Happy to have helped :-))
Trygve
0
All Courses

From novice to tech pro — start learning today.