Solved

center a report on application window

Posted on 2013-11-17
8
309 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 85
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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 85

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
 
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 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