How to set a printer

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two different printers. I want one to print out 1 report and the
other printer a different report.

So can I change the default printer with the touch of a button. What would
this code be?

Thanks
 
If you always want one report to print to a particular printer, open it in
design view, and choose:
File | Page Setup | Page | Specific Printer.

If you want to assign a printer on the fly, in Access 2002/2003 you can set
the Application.Printer object before you open the report.
 
Thanks both will be usefull I have question about the Appliation.Printer
I put that in and then .DeviceName

What do I put after DeviceName do I just put the name of the printer, also
do I have to enclose it in somthing like () "" []
Thanks for the help
 
Use a name that matches the one in the Printers collection, e.g.:
? Application.Printers(1).DeviceName

If that returns:
HP DeskJet 930C/932C/935C
you would use:
Application.Printer = Application.Printers(1)
or
Application.Printer = Application.Printers("HP DeskJet 930C/932C/935C")

For a downloadable example of using those objects, see:
Printer Selection Utility
at:
http://members.iinet.net.au/~allenbrowne/AppPrintMgt.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

pokdbz said:
Thanks both will be usefull I have question about the Appliation.Printer
I put that in and then .DeviceName

What do I put after DeviceName do I just put the name of the printer, also
do I have to enclose it in somthing like () "" []
Thanks for the help

Allen Browne said:
If you always want one report to print to a particular printer, open it
in
design view, and choose:
File | Page Setup | Page | Specific Printer.

If you want to assign a printer on the fly, in Access 2002/2003 you can
set
the Application.Printer object before you open the report.
 
thanks

Allen Browne said:
Use a name that matches the one in the Printers collection, e.g.:
? Application.Printers(1).DeviceName

If that returns:
HP DeskJet 930C/932C/935C
you would use:
Application.Printer = Application.Printers(1)
or
Application.Printer = Application.Printers("HP DeskJet 930C/932C/935C")

For a downloadable example of using those objects, see:
Printer Selection Utility
at:
http://members.iinet.net.au/~allenbrowne/AppPrintMgt.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

pokdbz said:
Thanks both will be usefull I have question about the Appliation.Printer
I put that in and then .DeviceName

What do I put after DeviceName do I just put the name of the printer, also
do I have to enclose it in somthing like () "" []
Thanks for the help

Allen Browne said:
If you always want one report to print to a particular printer, open it
in
design view, and choose:
File | Page Setup | Page | Specific Printer.

If you want to assign a printer on the fly, in Access 2002/2003 you can
set
the Application.Printer object before you open the report.


I have two different printers. I want one to print out 1 report and the
other printer a different report.

So can I change the default printer with the touch of a button. What
would
this code be?

Thanks
 
Back
Top