Stop a form from being maximised...

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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.
 
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.
 
Back
Top