Set Print Orientation to Landscape

J

jhrBanker

I've added a button to an Access Form to print the form. However, it prints
in Portrait and won't fit on the page. I've added the code "Let
Printer.Orientation=vbPRORLandscape", but am receiving the error "Invalid
Procedure call or argument". I want this to work for the Default Printer.
Any suggestions? Full code is:

Private Sub cmdPrintForm_Click()
Let Printer.Orientation = vbPRORLandscape
DoCmd.PrintOut
End Sub

Would appreciate any help. Thanks
 
R

Robbie Baquiran

I would write this like the following :

Private Sub cmdPrintForm_Click()
Dim frm As Form

Set frm = Me

frm.Printer.Orientation = acPRORLandscape
DoCmd.PrintOut

Set frm = Nothing

End Sub

Hope that helps!! Of coarse you can tone it down to just
Me.Printer.Orientation = acPRORLandscape, but I guess that's a preference
thing no?

-Robbie
 
Top