473,403 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 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 9796
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.