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

vba reports margins

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Sep 6, 2007
418
BE
Dear All,

There is a know problem of margins (a bug in access ?) that you have set manually, jump back to the default (rather large margins). Its enoying and I like to handle this by code. I found a nice peace of code to use vba to set the margins, eg, on the event on opening the main form. However the code, objects and build in methods seems to work only from versions 2002 and further.


Is there a way to use vba to set the margins width with version Access 2000 ?
 
You can set default margins under Tools->Options on the General tab.
 
you can do that, but he reset the margins to his default values after copy or moving the database and that is the problem.
 
You can set Options programmatically, however, options are stored in the registry and apply to all databases on the PC:

Code:
'Print margins, Left margin
SetOption "Left Margin", "1.50cm"

'Print margins, Right margin
SetOption "Right Margin", "1.50cm"

'Print margins, Top margin
SetOption "Top Margin", "1.50cm"

'Print margins, Bottom margin
SetOption "Bottom Margin", "1.50cm"

Have you looked at PrtDevMode, PrtDevNames, and PrtMip properties?


 
I found a few names in the code above (see the link), are these applicable in Access2000, if yes I can start to write my code.

At this moment my big concern is, how to fix the margins. I would try this on the event opening the main form of my application.

My report is not soo width, but larger then the default margins. The users are required to fix this manually and almost all users are not computerminded and my application lose the description "user friendly", for this it should happen automatically.

At this moment a report page become two pages because the default margins are to width.
 
If you mean PrtDevMode, PrtDevNames, and PrtMip properties, yes, these are suitable for 2000. I am a little puzzled as to why you are losing the margins. Have you tried setting the report to print to a specific printer under page setup? You may also wish to look at forum703.
 
No, if I google, it seems a broadly spread known problem of access and its very enoying because the default margins are large and most reports lay-out do not fit.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top