sphere_monk
Registered User.
- Local time
- Today, 00:18
- Joined
- Nov 18, 2002
- Messages
- 62
Hi all,
I'm running a pop-up form that allows the user to select a printer when a report has to be run.
There is a specific report that is designed to be printed in landscape mode in the report itself.
When the user prints the report using the "Print to Current Printer" button, the code behind the button prints the report in landscape, like it is designed:
When the user prints the report using the "Print to Different Printer" button (after selecting the same printer) the code behind the button prints the same report in portrait, essentially ignoring the fact that the report is designed to print in landscape orientation:
Just to be clear: the report is actually saved as landscape orientation in design mode. When I open the report in design mode, landscape is selected and saved.
Many different reports are printed using this form and the code associated with it, so I'd like to avoid any statements within the code that force landscape, if possible.
I don't have a lot of experience with this kind of code. Is there something in the code for the "Print to Different Printer" that could be ignoring the orientation saved within the report itself?
Any help you could provide would be greatly appreciated!
Dan
I'm running a pop-up form that allows the user to select a printer when a report has to be run.
There is a specific report that is designed to be printed in landscape mode in the report itself.
When the user prints the report using the "Print to Current Printer" button, the code behind the button prints the report in landscape, like it is designed:
Code:
Private Sub cmdPrintToCurrent_Click()
On Error Resume Next
DoCmd.OpenReport Me!txtReportName, acNormal
DoCmd.Close acForm, "frmSystemSelectPrinter"
End Sub
When the user prints the report using the "Print to Different Printer" button (after selecting the same printer) the code behind the button prints the same report in portrait, essentially ignoring the fact that the report is designed to print in landscape orientation:
Code:
Private Sub cmdPrintToDifferent_Click()
On Error Resume Next
Dim varReportName As String
varReportName = txtReportName.Value
DoCmd.OpenReport varReportName, View:=acPreview, WindowMode:=acHidden
Set Reports(varReportName).Printer = Application.Printers(cboSelectPrinter.ListIndex)
DoCmd.OpenReport varReportName, View:=acViewNormal
Forms!frm_Menu!cboSelectPrinter = Me!cboSelectPrinter
DoCmd.Close acReport, varReportName
DoCmd.Close acForm, "frmSystemSelectPrinter"
End Sub
Just to be clear: the report is actually saved as landscape orientation in design mode. When I open the report in design mode, landscape is selected and saved.
Many different reports are printed using this form and the code associated with it, so I'd like to avoid any statements within the code that force landscape, if possible.
I don't have a lot of experience with this kind of code. Is there something in the code for the "Print to Different Printer" that could be ignoring the orientation saved within the report itself?
Any help you could provide would be greatly appreciated!
Dan