Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sizing and centering forms ACCESS 2010

Status
Not open for further replies.

jpl458

Technical User
Sep 30, 2009
337
US
I have an ACCESS app the has several forms, and I want to size the forms and center them on the display. Some forms are larger than others. The app is in ACCESS 2010. I have looked on the web and in Tek Tips, but am still lost. There was an answer from Moneoman for this problem except that some entries he names in the Current Database' option in the Options list are not in mine.

From what I've read the might be code involved.

Any help or explanation would be greatly appreciated.

Thanks

jpl


 
Have you tried the movesize method? Not sure if it works with your version

hoof
 
Centering the form is easy. However, I suspect you want to center the controls within the Access window. It's not too complicated. You just need to determine the x (x1) coordinate of the left most control and the x (x2) coordinate of the right most control plus its width. Then determine the center of the 2 coordinates (x3=(x1+x2)/2). Now use me.innerwidth and determine the center of that (x4). Then determine the distance between the 2 centers (x5=x4-x3) and move all of your controls the distance of x5. Couple of things to be concerned about: 1. if you also want to center vertically, you have to take the different sections into play (i.e. Form Header, Page Header, details, etc). 2. Controls such as the tab control is a little tougher to move, because you have to first move the controls within the tab, then move the tab. But you can't move the controls outside the width/height of the tab control, so you have to resize it first, then when done resize it back to its original size. Also, could become larger than width/height of form which may cause an error. Also, if you're form is a split form, then all bets are off. The innerwidth does not report correctly on a split form.
 
jpl458,

To clarify, please specify what/how you want to "center":

1. Are you looking to center the application Window or Form Window on your computer screen as a whole object... or
2. Are you looking to center or perhaps just have a better layout for the very controls on the form.

Possible solutions:
1. For Centering the Access form as an object:
[ul][li]--The properties you were talking about (assuming what you were referring to are Auto Center and Auto Resize are showing in my copy of Access 2010 with an .accdb database.[/li]
[li]How to access those:[ul][li]Make sure you have your Form selcted as the object in the Property Sheet.. either select Form from the drop-down there, or click on the small square in the top left corner of the form... while in Design view[/li]
[li]Look on the Format tab.[/li]
[li]About 1/3 the way down.. close to halfway down, you should see Auto Center and Auto Resize[/li]
[li]Set those to Yes[/li][/ul][/li][/ul]

2. For Centering objects on your form
[ul][li]you can code it, like FancyPrarie and hoofit referred to[/li]
[li]You can somewhat automatically do this by using a layout.[ul]
[li]Select all the controls you want to include in the layout... select all of them if that's what you want (<Ctrl + <A>[/li]
[li]Either Right-Click on one of the selected controls and select "Layout" - and choose which method you want to try... OR in the Ribbon, under
---Form Design Tools
------Arrange (tab)
--------"Table" subsection, click Stacked or Tabular[/li]
[li]See what it looks at in Form or Layout view[/li][/ul][/li][/ul]

Let us know whether any of that suits you, or whether any of it is what you're looking for. But be specific in your requests... as specific as you can be.
 
I am very confused and lost as to how to set a permanent size for forms. Please help me also.


My new application has 10 data entry forms. For uniformity, when creating the forms in design mode, all forms are the same size. I am now testing my application in runtime mode, and when I open my application, the forms open MAXIMIZED.

How do I set the form size, to prevent the forms from opening maximized using tabbed forms.

Your help is very much appreciated!!!

 

are they showing in tabs? If so, that's the reason.

to change that:
[OL][LI]File Tab/Menu (Opens "Backstage")[/LI]
[LI]Select Current Database on the left[/LI]
[LI]Near the top, look for Document Window Options, change it to Overlapping Windows from Tabbed Documents[/LI]
[LI]Press OK[/LI]
[LI]Close and reopen your database after hitting OK at the message saying you have to close and reopen for changes to take place.[/LI]
[LI]Reapeat this for any such databases where you need this... if you need this for ALL databases, then there may be some other way to do it of which I'm unaware.[/LI][/OL]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top