I have a reports menu that allows you to print preview and/or print direct to the printer. I can successfully change printers but have not been able to change the orientation before the report prints. It works fine in print preview because you see the report first but doesn't when you take the default and not open the report. Does anyone know how to get around this? My code is:
'remember the default printer
If isBlank(Me!cmbPrinter.Value) Then
Me!cmbPrinter.Value = Application.Printer.DeviceName
End If
'grab the printer object for the selected report
Set Prt = Application.Printers(Me!cmbPrinter.Value)
'read user-specified settings
Prt.PaperSize = Me!cmbPapersize
Prt.DefaultSize = True
Prt.Orientation = Me!OpgOrientation
WhichReport (Me!lbxSelectReport.Value)
'added this line because it didn't seem to pick up the prt.orientation
Printer.Orientation = Me!OpgOrientation
DoCmd.OpenReport StDocName
The report works and goes to the printer direct but doesn't not switch orientations if I switch them on the menu.
Which report is a function that passes the report name
Thanks
Lhuffst
'remember the default printer
If isBlank(Me!cmbPrinter.Value) Then
Me!cmbPrinter.Value = Application.Printer.DeviceName
End If
'grab the printer object for the selected report
Set Prt = Application.Printers(Me!cmbPrinter.Value)
'read user-specified settings
Prt.PaperSize = Me!cmbPapersize
Prt.DefaultSize = True
Prt.Orientation = Me!OpgOrientation
WhichReport (Me!lbxSelectReport.Value)
'added this line because it didn't seem to pick up the prt.orientation
Printer.Orientation = Me!OpgOrientation
DoCmd.OpenReport StDocName
The report works and goes to the printer direct but doesn't not switch orientations if I switch them on the menu.
Which report is a function that passes the report name
Thanks
Lhuffst