Print Landscape

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: GeorgeMar (anonymous_at_discussions.microsoft.com)
Date: 07/15/04


Date: Wed, 14 Jul 2004 18:47:13 -0700

I have found an answer to getting a form to print in
landscape. But I now need a little more help.

Here is how it works.

The form can be changed to print landscape just like
reports.

In design mode, go to File>PageSetup>Page and change to
landscape and Voila! And the setting remains.

I did this through VBA and it too works. In a function,
put the following lines:

Forms!formname.form.printer.orientation=acPRORLandscape
Docmd.PrintOut

and again Voila!

Now for the piece de resistance, I want to do it for any
form that is in focus and it is not working. Can someone
help? here is a sample code that I am trying and the eval
portion is not working

dim frm as form
dim strForm as string

set frm=Screen.ActiveForm
strForm=frm.name

eval("Forms!" & strForm & ".form.Printer.Orientation=2")
'2 for landscape
docmd.printout

There are no errors but the eval() is ignored.

Many thanks
george

>-----Original Message-----
>I have a button the prints the form in focus but I cannot
>get the printer to print landscape. The form is too wide
>for portrait.
>
>Here is the what I am using in a print function and it is
>not working.
>
>Printer.Orientation=acPRORLandscape
>DoCmd.PrintOut
>
>It always comes out portrait.
>
>many thanks
>george
>.
>


Quantcast