Set Print Orientation to Landscape

G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top