question

BobVitter-0872 avatar image
0 Votes"
BobVitter-0872 asked DanielPineault-1898 answered

Unable to change printer parameters via VBA

I have tried the below code on multiple PCs and printers (HP Inkjet and Toshiba Studio) and neither printer prints duplex - both are capable of duplex and will print on both sides if Printer Preferences set


 DoCmd.OpenReport Report_Name, acViewDesign, , , acHidden
 With Reports(Report_Name).Printer
     .Orientation = acPRORPortrait
     .ColorMode = acPRCMMonochrome
     .Duplex = acPRDPHorizontal
 End With
 DoCmd.OpenReport Report_Name, acviewPreview
office-access-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DanielPineault-1898 avatar image
0 Votes"
DanielPineault-1898 answered BobVitter-0872 commented

I'd change the printer setting, for instance:

Dim prt As Printer
Set prt = Application.Printer
prt.Duplex = acPRDPHorizontal

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This works for orientation and duplex but Access seems to override the ColorMode setting
The printer default is B&W and I specify ColorMode = acprcmMonochrome but the report still prints in color
When I display the ColorMode is says Monochrome

0 Votes 0 ·
DanielPineault-1898 avatar image
0 Votes"
DanielPineault-1898 answered

What is done a lot of times is to create another instance of the printer with the desired setup and simply print to it, then you don't even need to mess around with any settings.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.