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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a Form Windowed

Status
Not open for further replies.

Kiernan

IS-IT--Management
Apr 30, 2003
43
US
I have a small "main-menu" form for my database. What I'd like it to do is open up in a window sized exactly for it in the exact center of the user's screen. I can get it to work the first time the database is opened, but if they manipulate the location, or maximize the window, the next time it appears as it was left by them, rather than windowed and centered again.

Can someone please tell me what is going wrong and how I would fix it?
 
Kiernan,

In the form properties, under 'Format', there is an 'Auto Centre' option, which should apply everytime the form is opened. I have a menu form like you which users swing all over the screen, but as soon as it gets reopened it's straight back to the middle.

 
Allowing them to maximize the form could be what is causing the problem. I forms I do not want changed I turn off the ability to maximize/minimize. Otherwise, you might try putting a DoCmd.Restore in the close event of the form. Sometimes this will work but only if the nothing previous to the form being maximized, was maximized or minimized. It basically is a sort of back button.

Kind of confusing, I know. I would just get rid of the Max/Min buttons.

Hope this helps,

Amy
 
I finally figured out the problem. I was doing as you both said, setting it windowed and centered plus removing the max/min buttons.

The problem came when they would use the menu to open another form, which was maximized. When they would exit the other form, which returned them to the main menu, it would be maximized.

For some reason, by hiding the database window, this is no longer an issue. The menu form returns to its windowed state upon exit from the second form. Still don't understand why, but it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top