Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2000 Reports - Print Landscape (Summary/Thoughts/Questions) 1

Status
Not open for further replies.

marcus101

Programmer
Jan 21, 2003
64
CA
Hey:

I need to "forcibly" set the page setup for many reports in an Access 2000 DB to landscape orientation.

There *may* be various reasons for this.

The most common is that the user who is accessing the DB *may* have default settings that override the Access core - ie: their system settings for their printer override the core design default I've tried to set in the DB.

In fact, I don't REALLY know for sure if when one sets a value for page layout in the DB it is actually stored anywhere anyway. This would explain why a lot of people are still struggling with this.

Would be nice to get a confirmation on that from some expert resource out there.

I'm aware of the various print properties that one can use in Access XP, but as far as I can tell, they DON'T work in 2000.

(IE: Application.Printer.Orientation = acPRORLandscape)

Short me writing a rather lengthy set of silly SendKeys commands to do this manually in the background, *IS* there a fairly simple VBA object component and a property setting for Access 2000 that will allow me to set print setup values?

Cheers,

marcus101
 
The orientation values are stored in the PrtDevMode structure along with the report. When printing occurs, any settings from the report are merged with the regular system settings to determine how the report will print. If you've set a report to print in landscape, it should overwrite any setting for the printer. This hold true regardless of whether the report is set to print on the default printer or not.

If you're not getting the correct orientation, the report may not have the proper settings at the time printing is done. You can force the setting in Access 2000, but only by opening the report in design view. If you're in an MDE you're out of luck.

The Orientation value is stored in bytes 44-47 of the DevMode byte structure. If Orientation is the only change you're making, you might get away with setting those bytes directly to the value you want (1 = Portrait, 2 = Landscape).

In Report_Open: Me.PrtDevMode(44) = 2 ' set Landscape

If that doesn't work you can always follow the standard documentation Access provides for changing DevMode properties with the LSET command. (It works for me when I use Access97.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top