Solved

center a report on application window

Posted on 2013-11-17
8
303 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

726 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