Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting orientation though code

Status
Not open for further replies.

DonS100

Programmer
Dec 4, 2001
104
0
0
US
How do you get the orientation of a report(Portrait or Landscape) though code? I tried the code below but it always gives me zero.

Thanks

Don

Dim rpt As Access.Report
Dim iOrientation = rpt.Orientation

Set rpt = Reports("Report1")
iOrientation = rpt.Orientation
 
Here is some code that was posted a while back, you can disregard the margin part...

Me.Printer.PaperSize = acPRPSLetter
Me.Printer.BottomMargin = 0.5 * 1440
Me.Printer.TopMargin = 0.5 * 1440
Me.Printer.LeftMargin = 0.5 * 1440
Me.Printer.RightMargin = 0.5 * 1440
Me.Printer.Orientation = acPRORPortrait
 
I should add, use the "on open" event of the report and it seems to work with newer versions of Access. I know some people with Access 97 couldn't get it to work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top