# MS Access - Changing Print default to Landscape



## Swanny86uk (Dec 1, 2006)

Hey,

I was wondering if it was possible to set the print orientation default to landscape from MS Access database. I have a few Macros that are executing queries into a print preview, however these print previews are always portrait. I am able to change the orientation manually but something that could have already set it to landscape would be wonderful. Is this even possible ?

I am doing this from work so I wont be able to mess with the print configurations outside of access. I don't have the 'power' =)

Marc


----------



## OBP (Mar 8, 2005)

With the Report open in Print Preview, select Setup>Page


----------



## Rollin_Again (Sep 4, 2003)

What version of Access are you using? Can you also post your existing code for us to look at?

In newer versions of Access you should be able to use the *Application.Printer* object. I don't believe this is supported in older versions of Access.


```
Dim vPrinter As Access.Printer
Set vPrinter = Application.Printer
vPrinter.Orientation = acPRORLandscape
```
You may also be able to manipulate the report properties using VBA as well where *strReportName* is a variable representing the report name. If you don't want to use a variable just use the actual report name enclosed within double quotes.


```
DoCmd.OpenReport strReportName, acViewDesign
Reports(strReportName).Orientation = 1 
DoCmd.Close acReport, strReportName, acSaveYes
DoCmd.OpenReport strReportName, acViewPreview
```
Regards,
Rollin


----------



## Swanny86uk (Dec 1, 2006)

Using Access 2000. How would I go about implimenting this Application.Printer object ?

Thanks !

Marc


----------



## OBP (Mar 8, 2005)

Why use VBA when you can "Fix" it in Landscape, just do as I sugested and then go back to design view and Save the report.


----------



## Rollin_Again (Sep 4, 2003)

I agree with OBP. In addition to this, Access 2000 does not support the Application.Printer object. There really is no need to change the report properties using VBA when it is easier to just change the view in the report properties manually and resave the report. Is there any particular reason why you want this done through automation?


Regards,
Rollin


----------



## slurpee55 (Oct 20, 2004)

I just am pitching in my agreement with the others - when I do a macro, it may be for print or print preview, but I set how the report looks (and ultimately prints) using design view of the report. Another advantage is that if you are working on the report, it is WYSIWYG - the way it looks as you build it is how it looks in preview or (more or or less, given the normal printing turmoil) how it appears on paper (or clay tablets or whatever you print on).


----------



## jimr381 (Jul 20, 2007)

I was debating on chiming in on this one for a bit. Even if you could set it up in Access to change the orientation to Landscape Access does not relayout the fields. You are on your own for doing that, so basically you would still be stuck with the same look and feel anyhow.


----------

