Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 6th, 2003, 12:04 PM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Command Button to Print in Landscape Orientation

If someone could tell me exactly how to make a command button that prints the page in landscape on one click, that'd be great.

Thanks!
 
Old June 6th, 2003, 12:50 PM
Authorized User
 
Join Date: Jun 2003
Location: Neverland, FL, USA.
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got this from google.com what you can do is adjust the margins see if that works. Go to Tools/Options and then the General Tab.



slypunk
 
Old June 6th, 2003, 12:56 PM
Authorized User
 
Join Date: Jun 2003
Location: Neverland, FL, USA.
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Check this one out...

>-----Original Message-----
>I have a button on my form that when clicked will use the 'PrintOut' macro
>event
>to print a query.
>
>Is there an extra bit of code I can run that will make the query print in
>landscape instead of portrait?
>
>Cheers!
>
>
>
>
>.
>
Look up the "PrtDevMode Property" in Access 2K help. Click
on "Example" and see if this will help. I use the Sub
SwitchOrient in my VB code for switching from portrait to
landscape on reports and it works nicely.

You have to place the Type statements and the SwitchOrient
sub (included in Example) in your Standard module.

Then I use a commandbutton on the form that runs the
report. This allows the user to switch from portrait to
landscape by pressing the commandbutton called SwitchView.
Module code for this is:

Private Sub SwitchView_Click()
On Error GoTo Err_SwitchView_Click

    SwitchOrient "MyReport"

Exit_SwitchView_Click:
    Exit Sub

Err_SwitchView_Click:
    MsgBox Err.description
    Resume Exit_SwitchView_Click

End Sub


--------------------------------------------------------------------------------


slypunk
 
Old June 9th, 2003, 11:59 AM
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




Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript print in landscape vsr Javascript How-To 0 November 14th, 2007 05:23 PM
Crystal Report Orientation = Landscape in asp agoz Classic ASP Professional 0 February 17th, 2006 04:15 AM
Divided by Zero and Print Landscape mateenmohd Classic ASP Basics 3 May 14th, 2005 05:01 AM
USING Command Button to print Worksheet alannoble Excel VBA 2 December 31st, 2004 11:17 AM
How can I print MsChart.object in landscape? all21 Beginning VB 6 0 December 10th, 2003 04:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.