Solved

Microsoft Access 2013 Reports Setting Margins programmatically  via VBA

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
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, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

809 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