Printing a form with Landscape Orientation

G

Guest

Is is possible to specify in VBA that I want the form to print in Landscape
orientation? The following is the code generated by Access when I used the
wizard to create a button to print the form. Thanks. Matt

Private Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection

Exit_cmdPrint_Click:
Exit Sub

Err_cmdPrint_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click

End Sub
 
V

Van T. Dinh

Generally, I recommend creating a Report for printing rather than trying to
print a Form.
 
G

Guest

The user wants to print an individual record that they are looking at in the
form. It would be easier to just click on the Print button and print out the
record. Does this mean that my original question is not possible? Thanks.
 
V

Van T. Dinh

* AFAIK, Forms don't retain Page Set-up settings like Reports do.

* You can create a Report that only prints the Current Record on the Form
just like printing the only the "Current Record" Form. Check Access VB Help
on the "wherecondition" argument of the OpenReport Method which can be used
to restrict the Report to the Current Record on the Form.

* In fact, Access makes it so easy to create a Report that looks like a
Form. In the Forms tab of the Database Containers window, right-click on
the Form and select Save As ... and select Report in the "As" option.
 
G

Guest

Excuse me butting in but I'd just like to say thanks for that last point. I
didn't know that Access could create a report that looks like a form so
easily. That might just come in handy sometime. JohnB
 

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