specify printer

S

samuel

I want to use the printout command to print a report to a specific printer.

The specified printer is not my default printer. How can I accomplish this?
 
A

Albert D. Kallal

samuel said:
I want to use the printout command to print a report to a specific printer.

The specified printer is not my default printer. How can I accomplish
this?

You don't mention what version of access your running, however there are
several ways to accomplish this goal.

One simple ways to simply open up the report in design mode and then go page
setup and then specify a particular printer and then save the report. When
you print that report it will go to that one particular printer regardless
of the default printer settings.

You can also use a coding approac.

In access 2002 and later, there is a built in printer object, and it lets
you switch the printer with ease.

You can use:

Set Application.Printer = Application.Printers("HP LaserJet Series II")


The above means you dont need my code.

So, to save/switch, you can use:

dim strDefaultPrinter as string

get current default printer.
strDefaultPrinter = Application.Printer.DeviceName

switch to printer of your choice:

Set Application.Printer = Application.Printers("HP LaserJet Series II")

do whatever.

Swtich back.

Set Application.Printer = Application.Printers(strDefaultPrinter)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top