469,304 Members | 1,800 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,304 developers. It's quick & easy.

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 9530
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

Post your reply

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

Similar topics

2 posts views Thread by Darcy Kahle | last post: by
4 posts views Thread by Jody Gelowitz | last post: by
3 posts views Thread by MarcJ | last post: by
5 posts views Thread by Patrick De Ridder | last post: by
5 posts views Thread by cpopham | last post: by
3 posts views Thread by D Witherspoon | last post: by
1 post views Thread by lord.zoltar | last post: by
6 posts views Thread by sheinaz | last post: by
2 posts views Thread by FireStarter | last post: by
2 posts views Thread by Brad Pears | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.