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

prevent a form from expanding to fill the screen 1

Status
Not open for further replies.

OhioSteve

MIS
Mar 12, 2002
1,352
US
I have auto resize set to "no" in all of my forms. In addition, I save them while they are displaying normally. Nonetheless, occasionally a form opens in full-screen mode. That is frustrating!

I used to know a very brief line of vba code that would stop that behavior. I THINK I put it into forms' onload event, and I THINK it included the word "resize". Can anyone jog my memory on that syntax?
 
You can create a simple macro with one action - Restore. Then put the macro on the Onload or OnOpen event.
 
Add the following to the OnOpen event for your form:
[tt]DoCmd.Restore[/tt]

HTH,
Larry
 
The reason your form is opening "maximized" is that the PRIOR form or window was maximized when it was closed. This is a rather annoying behavior of Access - unless specifically altered via the ".Restore" or ".Maximize" method, a form will open in the same visual sense as the prior open (with focus) form..

Form A Open - maximized...close A, open B - B opens Maximized...

Form A Open - "Restored" - close A, open B - B Opens "Restored" size...

If you need to maintain the size and aspect of your forms, the only way to really ensure that is to have the appropriate code in the ON OPEN event. Most of my systems have a mix of maximized and 'non-maximized' forms, so I've gotten used to coding that in every form..also, it helps if you make the form non-sizeable by the user as well... (THIN or DIALOG border type)



--------------------------------------
"For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled." - Richard P. Feynman
 
This is a rather annoying behavior of Access
This is standard behaviour for MDI Windows ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top