Hidden Forms Not Maximizing (1 Viewer)

Matty

...the Myth Buster
Local time
Yesterday, 21:50
Joined
Jun 29, 2001
Messages
396
I'm trying to speed up my database a bit my loading all the forms at startup and making them just visible/invisible instead of opening and closing forms all the time. So when my splash screen opens, I'm opening all the forms with a WindowMode of acHidden. When the splash screen closes, I open the Main form and maximize it.

The problem is when I make one of those pre-loaded forms visible, it doesn't open maximized. I was under the assumption that if one of the forms in the MDI is maximized, all forms are maximized. Does that only apply to visible forms, or forms that open AFTER that main form is maximized?

I've tried running a DoCmd.Maximize on the Activate event of all the forms, but I run into problems there too. The Activate event fires when I first load the form (hidden) but it doesn't stay hidden if it gets maximized via code.

Is there any way for me to pre-load my forms and have them appear maximized when I make them visible?
 

realnine

Registered User.
Local time
Yesterday, 22:50
Joined
Jun 10, 2003
Messages
40
Try this
The AutoResize property uses the following settings.

Setting Visual Basic Description
Yes True (Default) The Form window is automatically sized to display a complete record.
No False When opened, the Form window has the last saved size. To save a Form window's size, open the form, size the window, save the form by clicking Save on the File menu, and close the form. When you next open the form, it will be the saved window size.


You can set this property by using the form's property sheet, a macro, or Visual Basic.

This property can be set only in Design view.
 
R

Rich

Guest
Private Sub Form_Resize()
DoCmd.Maximize
End Sub
 

Matty

...the Myth Buster
Local time
Yesterday, 21:50
Joined
Jun 29, 2001
Messages
396
Well, I've figured out a temporary solution that'll do what I want it to for now. Since the DoCmd.Maximize method maximizes the form with the focus, I just set focus to the form I want to maximize and then call the Maximize method. I had assumed before that DoCmd.Maximize only maximizes the form in which the code was in, but setting focus and then calling it does the trick.

I'm still trying to figure out why they don't stay maximized in the first place, but this will do for now.
 

Users who are viewing this thread

Top Bottom