Solved

Microsoft Access 2013 Reports Setting Margins programmatically  via VBA

Posted on 2014-11-26
3
241 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

839 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