Solved

Microsoft Access 2013 Reports Setting Margins programmatically  via VBA

Posted on 2014-11-26
3
218 Views
Last Modified: 2014-11-26
I need to set a report margins when the reports open. I want it set to 1.75".  I think that I am suppose to use Twips in the code. What is the code for setting the left margin to 1.75" or I think 2520 Twips. Does anyone have code for this? Where do I put this code?
0
Comment
Question by:marlind605
3 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40466729
See this answer: http://www.experts-exchange.com/Database/MS_Access/Q_26697234.html

You are correct - there are 1440 twips per inch, so 1.75" is 2520 twips.
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 40466737
try

docmd.openreport "NameOfReport",acviewpreview
with Reports!NameOfReport.printer
    .topmargin=2520
    .bottommargin=2520
    .leftmargin=2520
    .rightmargin=2520
end with
0
 

Author Closing Comment

by:marlind605
ID: 40466802
Thanks for both replies. The first one solved the problem.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now