472,805 Members | 2,118 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

Help Printing in landscape

Ok I have my program printing out query results from my form using this

Expand|Select|Wrap|Line Numbers
  1. On Error GoTo Err_Command47_Click
  3.     Dim stDocName As String
  4.     Dim MyForm As Form
  6.     stDocName = "query_1 subform"
  7.     Set MyForm = Screen.ActiveForm
  8.     DoCmd.SelectObject acForm, stDocName, True
  9.     DoCmd.PrintOut
  10.     DoCmd.SelectObject acForm, MyForm.Name, False
  12. Exit_Command47_Click:
  13.     Exit Sub
  15. Err_Command47_Click:
  16.     MsgBox Err.Description
  17.     Resume Exit_Command47_Click

My problem is it doesnt print in landscape so instead of taking up 2 pages it takes up 5. How can I get it to print in landscape, I have it set on page setup but it still wont do it.
Jan 18 '07 #1
8 9738
159 Expert 100+
try inserting
Printer.Orientation = acPRORLandscape
before the print command. you can access most of the print setup properties this way.

hope this helps,
Jan 18 '07 #2
I tried that and it didnt work. Any other ideas?
Jan 19 '07 #3
Oh yeah forgot to put that the error its giving me is Invalid Procedure call or argument
Jan 19 '07 #4
Well it prints but not in landscape.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command47_Click()
  2. On Error GoTo Err_Command47_Click
  4.     Dim stDocName As String
  5.     Dim MyForm As Form
  9.     stDocName = "query_1 subform"
  10.     Set MyForm = Screen.ActiveForm
  11.     DoCmd.SelectObject acForm, stDocName, True
  12.     Printer.Orientation = acPRORLandscape
  13.     DoCmd.PrintOut
  14.     DoCmd.SelectObject acForm, MyForm.Name, False
  16. Exit_Command47_Click:
  17.     Exit Sub
  19. Err_Command47_Click:
  20.     MsgBox Err.Description
  21.     Resume Exit_Command47_Click
  23. End Sub
Thats what I am using do I need to put the printter.orientation in a different spot
Jan 19 '07 #5
I got it figured out, I just decided to bring up the page setup and print options using a domenuitem command.
Jan 19 '07 #6
159 Expert 100+
What version of Access are you using? I just Did a google search and found that the printer collection is new to Access 2002. here is a link to the white page.
it gives information on the how to use the printer collection and also a link to download (although I 've never had to download anything).
Jan 19 '07 #7
3,080 Expert 2GB
Before A2002 the only way to get a report/form to print in landscape will be to open the report/form in design mode and use the File/Page settings to set the print preferences.
This will however be reset when you chose to use a different printer :-(

For managing it from code there's some info here:
but it's a real hassle...

Jan 20 '07 #8
I got it figured out, I just decided to bring up the page setup and print options using a domenuitem command.
How did you do this? I'm trying to get a command button to print a pivot chart in landscape and I can't find a solution anywhere.

My knowledge of VB is limited!!


Mar 23 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Darcy Kahle | last post by:
I am trying to do some advanced printing in python using the win32ui module, and have run into an issue. I need to print a page landscape. As I could not determine how to specify the orientation...
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
by: MarcJ | last post by:
Hello, I can't seem to get printing to landscape working. Here is some of the code I've tried. '--------------------------------------------------------------------------------- Dim...
by: Patrick De Ridder | last post by:
How can I turn what I want to print 90 degrees using the logic below? Please tell me the code with which to make the modification. Many thanks, Patrick. using System.ComponentModel; using...
by: cpopham | last post by:
I tried posting earlier and it never showed up.. I have a simple program to print a text file. I need to know how to change the page settings to landscape if it is not already in ladnscape mode. ...
by: D Witherspoon | last post by:
No matter what I do the default paper size is always either A3 or 11 by 8.5 .. Here is the code. Dim dlg As DialogResult pd.DocumentName = "Weld Image" Dim pkPaperSize As New...
by: lord.zoltar | last post by:
Hi, I'm trying to print a text report from an application. It works fine, except in landscape mode, which it seems to ignore. I have a function that handles the PrintPage even for the...
by: sheinaz | last post by:
Hi I am tryign to use this to print my table in landscape by default. i am new at the xsl and need some assistance. when i try to use the following i get the error: Cannot view XML input using...
by: FireStarter | last post by:
I am apparently unable to print landscape... maybe I'm doing something wrong here. I am adding a printDocument to a form. The form also has a textbox containing the text that I want to print and...
by: Brad Pears | last post by:
I have a vb.net 2005 application and am using the print preview screen. This screen has a printer icon on it that the user can use to print the document currently being viewed. It uses the default...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: lllomh | last post by:
How does React native implement an English player?
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.