Automatic Printer Selection?

shaggy

Registered User.
Local time
Today, 17:48
Joined
Sep 9, 2002
Messages
41
Is there a way to have a report automatically print to the correct printer based on a value in the report or a value in the query that generates the report.

We print reports through our network in different district offices. We have a district field in our database which identifies the source of the data, but we have to manually select the printer everytime we print a report for those offices. The data in the report is always only for one district. It is never mixed.

The report defaults to one of the printers. I could create a duplicate report for each office with a different default printer, but I was just wondering if there was another way to do this.
 
This is code for Access 2002. I understand that Access 2000 code is several hundred lines long.

The source for the following code is Getz Litwin & Baron's Access CookBook, published by O'Reilly.
.
private sub form_load
call FillPrintersList(me.cboprinters)
me.cboprinters=application.printer.devicename
end sub

private sub FillPrinterList(ctl as control)
dim prt as Printer
ctl.rowsourcetype="Value List"
for each prt in Application.printers
ctl.additem prt.devicename
next prt
end sub

private cboprinters_afterupdate()
dim lngIndex as long
lngindex=me.cboprinters.listindex
set application.printer=application.printers(lngindex)
end sub
 

Users who are viewing this thread

Back
Top Bottom