View Full Version : Resize Form


PuJo
10-13-2006, 01:08 PM
In my db, I have a form set to open on start.
Is there anyway to set this to auto resize Maximize? (if you know what I mean)
Thanks again,
Pujo

"On The Bayou"

boblarson
10-13-2006, 01:28 PM
In your form's On Open event put:


DoCmd.Maximize


Now, just be aware, in case you didn't know, that if you maximize one object the rest of the objects maximize (all forms, reports, database window). If you want to reset it so they aren't, on the form's On Close event put:


DoCmd.Restore

gemma-the-husky
10-13-2006, 01:31 PM
put this in the forms open event

Private Sub Form_Open(Cancel As Integer)
Application.RunCommand acCmdAppMaximize
Application.RunCommand acCmdDocMaximize
End Sub

the first line expands the access app
the second expands the current form

PuJo
10-13-2006, 01:44 PM
You guys are great!!!!!
Work like a charm.

Have a great weekend.
God Bless,
Pujo


"On The Bayou"

Luddite Lad
10-13-2006, 05:03 PM
Gemma what are the pros and cons of using the method you have suggested and the method suggested by Boblarson?

boblarson
10-13-2006, 08:48 PM
Both of them should work fine. Mine is something I use in all of my reports since I don't like other maximized objects.

Gemma's code maximizes the Access window first and then the object. However, there was no mention of restore, which is what I use to come back to non-maximized forms after closing the report.

It's all a personal preference.

Luddite Lad
10-14-2006, 12:14 AM
Thanks Bob, yours is the method I use. Iwas just interested if there was any benift in the method outlined by Gemma.

gemma-the-husky
10-14-2006, 03:44 AM
i never maximize forms, because i prefer to see bordered forms where possible. I just knew the commands were there.

I actually save and restore the positions and screen locations of forms in the registry using standard access commands, on the load and close events, so that when users re-open forms they return to their last location.

statsman
10-14-2006, 06:52 AM
I always maximize everything when I open a database by using the Autoexec macro.

You've got this big screen. Why just use a portion of it?