How do i programmatically create a query in MS Access default to landscape when printed, particularly when viewing it as being a PivotChart? I am presently trying this in MS Access 2003, but want to visit a solution for just about any version.
The next function should have the desired effect:
Function SetLandscape() Application.Printer.Orientation = acPRORLandscape End Function
Should have the ability to refer to this as in the autoexec function to make sure it always runs.
Yes ahockley's call sets the application's printer orientation to landscape. I attempted an experiment also it labored well. I understand this does not create a pivot table, however i did not setup someone to use, therefore it opens and prints a normal query.
Private sub Application.Printer.Orientation = acPRORLandscape DoCmd.OpenQuery "qry1", acViewNormal, acReadOnly DoCmd.PrintOut acPrintAll End Sub
If you wish to close the query after printing it, add:
docmd.Close acQuery, "qry1", acSaveNo