Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
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!
Reply With Quote
  #2 (permalink)  
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
Reply With Quote
  #3 (permalink)  
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
Reply With Quote
  #4 (permalink)  
Old June 9th, 2003, 11:59 AM
Friend of Wrox
Points: 3,947, Level: 26
Points: 3,947, Level: 26 Points: 3,947, Level: 26 Points: 3,947, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,150
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
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript print in landscape vsr Javascript How-To 0 November 14th, 2007 04:23 PM
Crystal Report Orientation = Landscape in asp agoz Classic ASP Professional 0 February 17th, 2006 03: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 10:17 AM
How can I print MsChart.object in landscape? all21 Beginning VB 6 0 December 10th, 2003 03:48 AM



All times are GMT -4. The time now is 05:29 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.