Changing printer settings

A

anjee

Hello,
I am trying to change/set specific printer settings (what printer to
use, papersize, number of copies, etc...) using the Access 2003
printer object, however it does not work if the report prints directly
to the printer (no preview). Does anyone know how I can change
printer settings for a report without actually viewing the report
first? Here is my code that does work when previewing the report.
The process fails when it tries to set the rpt variable to the current
report from the Reports object. This is because the report is not
loaded. BTW, the report does print, however it does not take on the
new settings...uses the settings of the report itself.

Dim rpt As Access.Report
Dim prtr As Access.Printer

Set prtr = Application.Printer
prtr.PaperSize = acPRPSEnv9
prtr.Copies = 4
prtr.DataOnly = True

DoCmd.OpenReport sReportName, vPrintPreview, , sParam
'CODE FAILS ON NEXT LINE
Set rpt = Reports(sReportName)
'Set the Printer property of the report to the Application.Printer
object
Set rpt.Printer = prtr

Thank you for any help.
 

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