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

Open Access window with a fixed size

Status
Not open for further replies.

lizray

Programmer
May 14, 2008
126
AU
When I open the database, the main access window has the correct size, but is a user changes the size (eg maximize) and closes the database, when it is opened next time it uses the last saved size; I would like it to always open with the original size. Does anyone have a suggestion ?
 
I always put a DoCmd.MoveSize command in the start of the code for ALL my forms. That way the user can't change the form other than by using the minimize or maximise buttons, and it will always reset when the form is next opened to the proper size.
 
Thanks Locoman. I am not familiar with movesize, I am not sure how to use it, Does it work for the main access application window?
 
Hi Liz, no unfortunately it does not work for the main Access application. You have to add it to the 'OnOpen' code for each form. This sounds as though it is a bit of a chore but does have the advantage of allowing you to set the exact size of each form. As well as defining the form size it allows you to do smart tricks such as temporarily repositioning a form over part of another form - e.g. in one corner - if that suits your application.

To use MoveSize you specify both the onscreen position and the specific dimensions of the form itself in the order Down, Right which specifies the position of the top left corner of the form from the top left corner of the screen, then Width and Height of the form itself. Any non-required or unused parameters are replaced by commas. All parameter dimensions are in 'TWIPS' (1 twip = 1/1440 inch or 1/576 centimeter)

Enjoy!
 
I checked and found that my typical VBA code for each form was actually in the OnLoad area trather than OnOpen, although I don't think it make a difference.
I also forgot to say that with your user's habit for changing things it's probably a good idea to put a DoCmd.Maximise before the DoCmd.MoveSize in the VBA. That should leave you totally in control on every form.
 
Thanks to both replies. The Info at the microsoft link solved the problem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top