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
  2.  
  3.     Dim stDocName As String
  4.     Dim MyForm As Form
  5.  
  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
  11.  
  12. Exit_Command47_Click:
  13.     Exit Sub
  14.  
  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
MSeda
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,
Megan
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
  3.  
  4.     Dim stDocName As String
  5.     Dim MyForm As Form
  6.  
  7.  
  8.  
  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
  15.  
  16. Exit_Command47_Click:
  17.     Exit Sub
  18.  
  19. Err_Command47_Click:
  20.     MsgBox Err.Description
  21.     Resume Exit_Command47_Click
  22.  
  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
MSeda
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.
http://msdn.microsoft.com/library/de...0_Printers.asp
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
nico5038
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:
http://www.mvps.org/access/reports/rpt0009.htm
but it's a real hassle...

Nic;o)
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!!

Cheers,

Dave
Mar 23 '07 #9

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

Similar topics

2
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...
4
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...
3
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...
5
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...
5
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. ...
3
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...
1
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...
6
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...
2
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...
2
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...
2
isladogs
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...
0
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...
0
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 ...
14
DJRhino1175
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...
0
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...
5
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...
0
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=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
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.