Stop a form from being maximised...

G

Guest

I have a small form with a couple of combo boxes and buttons on it. I when
the form is loaded it appears in a small box less than a quarter of the size
of the screen, how can I prevent this from being maximised?

I have set it to be a dialog box with auto resize on, however if the form
with the button on used to load said form is already maximised, when the form
is opened, it too is maximised, but I don't want to as you end up with 3/4s
of the screen a single colour.
 
G

Gary Beale via AccessMonster.com

In the OnOpen event enter vba code as follows:

docmd.restore

This will restore the window size to whatever you have saved it as. If you
have forms that you want to be maximized you may have to use docmd.maximize
in the same way to open them maximized. It depends where and how your
forms open.
 
M

Mark M

When you call the OpenForm routine, opening your dialog form as a Dialog
window type should do it. I have noticed, though, that sometimes (mostly
right after some design editing) the first time my dialog form opens, it's
maximized. But when I close it and then click my button to open it again,
it's just fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top