Solved

center a report on application window

Posted on 2013-11-17
8
279 Views
Last Modified: 2013-12-29
I would like to center a ms access report on the application screen using vba.Thanks
0
Comment
Question by:Svgmassive
  • 4
  • 2
  • 2
8 Comments
 
LVL 84
ID: 39656361
Just set the Auto Center property to True. Open the report in Design view, open the Property Sheet, and select the Format tab. You'll see Auto Center in the listing - set that to True.
0
 

Author Comment

by:Svgmassive
ID: 39656623
VBA
0
 

Author Comment

by:Svgmassive
ID: 39656625
I can do that but that's not what i am looking for
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 39656787
You can use DoCmd.MoveSize to manipulate the position of an object in Access:

DoCmd.MoveSize 2880, 2880

This would move the object to approximately 2 inches below the top, and 2 inches to the right of the screen edge. The values above are in Twips, and 1440 Twips = 1 inch (approximately).

As to "center" - you'd have to further define that. Do you mean the center of the Screen, the center of the Access application, center of another object ... etc etc

Here's a link to a module on the MVPS website that goes into a little more depth: http://access.mvps.org/access/forms/frm0042.htm
0
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.

 
LVL 21
ID: 39657421
Could you be wanting to change the Zoom level?

Example:

DoCmd.OpenReport "rptYourReport", acViewPreview
DoCmd.RunCommand acCmdZoom100 

Open in new window



or maybe this method:

In the report's On Open event try using this code:

DoCmd.Maximize
DoCmd.RunCommand acCmdZoom100

Open in new window


You may also need to include in the report's CLOSE event to use this:
 
DoCmd.Restore

Open in new window

0
 

Author Comment

by:Svgmassive
ID: 39683697
still have not been able to have this issue addressed.
0
 
LVL 21
ID: 39683832
I think there is some confusion as to what you want. I know am am not sure what you really want.

Between LSMConsulting's suggestions and mine, we have covered the common solutions when people ask about "centering" a report.

In Access 2007 or later, there is  Print Preview mode and Report View mode. You may be wanting Print Preview mode.

I am confident we can provide a solution once we understand exactly what you want. Can you example in more detail exactly what you are needing?

Also it would hep to know:
What version of Access?
Are you display the report in Print Preview mode  or Report View mode (2007 or later)?
0
 

Author Comment

by:Svgmassive
ID: 39685082
I am using access 2010,Here's the problem,I am using the custom function PreviewAndZoomReport i would like to set my own zoom value when i specify a value the report opens to the left of the screen even with the autocenter set to yes,I would like to use vba to center the report on the screen.thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

863 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

27 Experts available now in Live!

Get 1:1 Help Now