Size and position of a form from a maximized form

Danick

Registered User.
Local time
Today, 15:48
Joined
Sep 23, 2008
Messages
377
I have a form that is set to Max on open (DoCmd.Maximize)
Inside that form is a command button that opens another form that I do not want maximized. So on open event for that form, I have

DoCmd.MoveSize 5000, 3000, 6000, 2500

But this is getting ignored and that form opens maximized as well. How can I keep the initial form maximized while letting other forms open to a custom size and position?

Thanks
 
Hi. Have you tried setting the PopUp property of the second form to Yes?
 
Thanks, yes that works. But then my form goes off the screen. I have two monitors. So setting the popup to Yes keeps it the right size, but it puts in on the wrong monitor. I'm still playing around with it, but it seems to work by putting the AutoCenter to Yes and getting rid of the position.

So now I have it "somewhat" working by using DoCmd.MoveSize , , 6000, 2500
This doesn't put the form exactly where I want it, but at least it's not off the screen.

Thanks for responding.
 
Hi. You're welcome. Glad to hear I was able to help a little bit. Good luck with the rest of it. Cheers!
 
If you are concerned about precisely sizing and locating forms you probably want to look at
@isladogs form resizer.
 
Try adding the code line DoCmd.Restore in the Form_Load event of the 2nd form.


I tried that but it unfortunately also restores the underlying form which I need to keep maximized.
In the end I think I found a simple way of doing it by simply getting rid of all move and sizing code and then just manually resizing it and moving it to where I'd like to see it on the screen. This seems to be working fine for now.

All of this just because I didn't like where the spell checker positions the OK dialog. I couldn't find a way to re-position that access msg box dialog that says the spell check was completed - so I made my own....
 
By chance, does this form load a query in datasheet view?

If so, try changing to continuous forms view to control the window size.

Alternatively, you could try putting the datasheet in a subform which would also prevent it from resizing the window.
 
By chance, does this form load a query in datasheet view?

If so, try changing to continuous forms view to control the window size.

No it's a single form that opens another single form
 

Users who are viewing this thread

Back
Top Bottom