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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Margins in VBA

Status
Not open for further replies.

tickko

Programmer
Dec 12, 2002
25
0
0
US
Just wondering if theres a way to program margins of a report during the open sub? In a few of my databases with complex reports, the page is set to landscape with .25 margins. When openning the report, the page is set back to portrait and 1 inch margins. Any help would be greatly appreicated!

Thanks,
j
 
I have quite a few reports that I call from VBA that are set to Landscape and various margin widths and have never had a problem.

Did you change the page layout in design view and save the changes? This is how I do it and like I said I have never had a problem.

I don't know how to set the page setup with VBA though.
 
i constantly have to update the orientation and margins, sometimes it will stick but the majoritity of the time it resets to the default. i know that i can change the global options in Access but that only works for the margins.

thanks,
j
 
I would appreciate an answer to this question also, as I have a report which, when output, erratically alters the margins to the default causing wasted paper & stress.

Many thanks


Philcon
 
This happens to Access 2000 applications that don't have the latest service packs installed. A quick fix is to select Tools|Options|General and uncheck all Name AutoCorrect boxes.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Same problem here. We develop on two different machines, then move a deliverable to a server with several clients. We are constantly resetting margins and print mode. And we have the latest service packs on all of our machines. Running Windows Server 2000, and clients are running Win2K. There must be something more to this.
 
Do you have all the NameAutocorrect options turned off?

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Autocorrect seems pretty important to me, so I left them checked.
 
tickko,

thread702-560490 addresses this.

Autocorrect is mentioned at the end of that thread.


HTH,
Bob
 
Dear tickko,

If you are using Access XP you might try the printer object
[blue]
Application.Printer.LeftMargin =
Application.Printer.Orientation = acPRORLandscape
[black]
The printer object is exposed in later versions of Access.
I have not used these features, so I can only point you in the right direction.

Hope this Helps,
Hap [2thumbsup]


Access Developer [pc] Access based Add-on Solutions
Access Consultants forum
 
If using MS Office 2000 make sure that you instal Service Pack 1 and 3. This will take care of printer settings.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top