S
SFAxess
-also posted in the Reports subdomain
Hello,
I have been unable to successfully change the printer's paper bin setting
before printing a report. I have tried using the Access Developer's Cookbook
example code for this, but it does not work. I pulled my printer's paper bin
mapping from the Win API, so I know I am setting the property to the correct
values. I also tested the printer by selecting the trays from the printer
dialog and everything printed out to the correct tray. The code I have been
using is shown below:
Private Sub PrintReportToUpperTray()
On Error GoTo HandleError
Dim rpt As Report
DoCmd.Echo False
DoCmd.OpenReport "MyReport", acPreview
Set rpt = Reports("MyReport")
rpt.Printer.PaperBin = acPRBNUpper
DoCmd.PrintOut acPrintAll
ExitHere:
On Error Resume Next
Set rpt = Nothing
DoCmd.Close acReport, "MyReport", acSaveNo
DoCmd.Echo True
Exit Sub
HandleError:
MsgBox Err.Description & "(" & Err.Number & ")"
Resume ExitHere
End Sub
Has anyone had any successful attempts doing this? According to the Access
Developer's Cookbook, this should work.
Hello,
I have been unable to successfully change the printer's paper bin setting
before printing a report. I have tried using the Access Developer's Cookbook
example code for this, but it does not work. I pulled my printer's paper bin
mapping from the Win API, so I know I am setting the property to the correct
values. I also tested the printer by selecting the trays from the printer
dialog and everything printed out to the correct tray. The code I have been
using is shown below:
Private Sub PrintReportToUpperTray()
On Error GoTo HandleError
Dim rpt As Report
DoCmd.Echo False
DoCmd.OpenReport "MyReport", acPreview
Set rpt = Reports("MyReport")
rpt.Printer.PaperBin = acPRBNUpper
DoCmd.PrintOut acPrintAll
ExitHere:
On Error Resume Next
Set rpt = Nothing
DoCmd.Close acReport, "MyReport", acSaveNo
DoCmd.Echo True
Exit Sub
HandleError:
MsgBox Err.Description & "(" & Err.Number & ")"
Resume ExitHere
End Sub
Has anyone had any successful attempts doing this? According to the Access
Developer's Cookbook, this should work.