Changing Orientation to Landscape

Dina01

Registered User.
Local time
Today, 16:36
Joined
Apr 24, 2002
Messages
87
Hello ,

I have a db that has a form and when I choose the View or Print Option and then I click on the PrintButton.

It will print out my report, but I want this report to Print or be viewd in Landscape.....


This is the code I have in my form to print the report..

*******************************************
Private Sub PrintButton_Click()
Dim WClause
Const RName = "rptTrackAgent"
WClause = "[Date] Between #" & _
Me![Start] & "# AND #" & _
Me![End] & "# AND [Agent] = '" & _
Me![Agent] & "'"

If DCount("*", "qryAgentTracking", WClause) Then
DoCmd.OpenReport _
Reportname:=RName, _
WhereCondition:=WClause, _
View:=Me![OutputTo], _
Orientation:=acPRORLandscape

Else
MsgBox "No Matching Records"
End If
End Sub

But My program bugs everytime at the Orientation:=acPRORLandscape


Does anyone one know how to do this in VB Code...
 
Go to File Menu, Page setup, page tab and choose landscape. Why does it have to be done in code?

Hay
 
It's because I have a few forms that call the reports and some of them I want to be able t print in Portrait and some inLandscape...I also have to make sure that if I am using it from another PC it stillworks fine.......
 
To the best of my knowledge there is no such thing as an orientation parameter for the OpenReport action. if you really want to do that through code you will have to look up code sample for the prtDevMode property in Access Help.

But on principle you would just save each of the reports you create after setting the orientation you want it to use. Acess should keep this setting whatever the compuer your db is installed on. If you work with A2k maje sure to disable the AutoCorrect feature before anuthing else since there is an acknowledged bug that reset reports printing oprions when you don't (solved in SP1?)
 
Last edited:

Users who are viewing this thread

Back
Top Bottom