Print report to .pdf

  • Thread starter Thread starter Terry Clites
  • Start date Start date
T

Terry Clites

I'm searching for an scaled down way to print reports to .pdf format
directly from a form that selects multiple reports for review or printing.
It would seem that there is a simpler method rather than the copious amounts
of coding required to set the default to Acrobat Distiller and back again.
Is it not possible to simply code the Distiller printer as the selected
printer for output within the form's command button "On Open" event handler
that opens the selected reports? I've seen very detailed modules dedicated
to printer output operations. But it seems overkill for the simplicity
required. Maybe some db guru could explain the issue of this complexity.

Thanks all
 
You don't mention what version\ of ms-access.

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 don't 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)


If you are using a earlier versions, then you can use my lightweight printer
switch code here:

http://www.attcanada.net/~kallal.msn/msaccess/msaccess.html
 
Back
Top