View Single Post
  #4 (permalink)  
Old June 9th, 2003, 11:59 AM
SerranoG SerranoG is offline
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

If you're talking about a report, then the following will spit out your report in Landscape view without a preview. You'll probably have to tweak it to fit your variables, etc.

    Dim strPrinter As String
    Dim rptReport As Report, strReport as String

    strPrinter = Application.Printer.DeviceName
    strReport = "MyReport"

    DoCmd.OpenReport strReport, acViewPreview, , , acHidden

    Set rptReport = Reports(strReport)
    Set rptReport.Printer = Application.Printers(strPrinter)

    rptReport.Printer.Orientation = acPRORLandscape
    'Set it to acPRORPortrait for portrait.

    DoCmd.OpenReport strReport, acViewNormal
    DoCmd.Close acReport, strReport


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote