Form Sizing

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

Help!

This is probably something very simple but I can not work
it out!

I have a form which maximises using "DoCmd.Maximize" in
the "On Open" which works fine. On this form there is a
button that runs a macro, the macro simply opens, prints,
then closes a completly separate form (the only link
being a where condition for what information to print).

When the print form closes the first form resizes, I can
not make it stay maximized. Please help!

Regards - Gary
 
Hi Gary

Are you sure that the second form is not executing a DoCmd.Restore at some
point?

In any case, you should move your DoCmd.Maximize from Form_Open to
Form_Activate, so that it happens again whenever the form loses and then
regains the focus.

Also, you might like to open the second form modally, by calling
DoCmd.OpenForm with WindowMode:=acDialog. This should make it open in
non-maximized mode, and it won't affect your first form.
 
Hi Graham, that seems to have fixed that issue - thank
you.

The was going to be my next question about how to open
forms (from the first) in a smaller window. I am a bit
new to this, so please can you explain where and how to
made this happen?

Many thanks - Gary
-----Original Message-----
Hi Gary

Are you sure that the second form is not executing a DoCmd.Restore at some
point?

In any case, you should move your DoCmd.Maximize from Form_Open to
Form_Activate, so that it happens again whenever the form loses and then
regains the focus.

Also, you might like to open the second form modally, by calling
DoCmd.OpenForm with WindowMode:=acDialog. This should make it open in
non-maximized mode, and it won't affect your first form.

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Help!

This is probably something very simple but I can not work
it out!

I have a form which maximises using "DoCmd.Maximize" in
the "On Open" which works fine. On this form there is a
button that runs a macro, the macro simply opens, prints,
then closes a completly separate form (the only link
being a where condition for what information to print).

When the print form closes the first form resizes, I can
not make it stay maximized. Please help!

Regards - Gary


.
 
Hi Gary
Hi Graham, that seems to have fixed that issue - thank
you.

You're welcome :-)
The was going to be my next question about how to open
forms (from the first) in a smaller window. I am a bit
new to this, so please can you explain where and how to
made this happen?

The 6th argument of OpenForm is WindowMode, which specifies how the form's
window will appear. If you set this argument to acDialog, then the form
will be "modal", which means that the form will be on top of everything
else, and all other activity will be suspended until that form is closed or
hidden. Also, the current setting of Maximize etc will have no effect on
the new form's window.

For example:
DoCmd.OpenForm "frmMyPopup", , , , , acDialog
or, using named arguments which are easier to read and less prone to
mistakes:
DoCmd.OpenForm "frmMyPopup", WindowMode:=acDialog

If you don't want the form to be modal (a rare occurrence) then you will
need to put DoCmd.Restore in the second form's Activate event procedure, and
DoCmd.Maximize in the first form's.
 
Graham you are a STAR!!! Thank you - works perfectly! :o)
Many Thanks - Gary
-----Original Message-----
Hi Gary
Hi Graham, that seems to have fixed that issue - thank
you.

You're welcome :-)
The was going to be my next question about how to open
forms (from the first) in a smaller window. I am a bit
new to this, so please can you explain where and how to
made this happen?

The 6th argument of OpenForm is WindowMode, which specifies how the form's
window will appear. If you set this argument to acDialog, then the form
will be "modal", which means that the form will be on top of everything
else, and all other activity will be suspended until that form is closed or
hidden. Also, the current setting of Maximize etc will have no effect on
the new form's window.

For example:
DoCmd.OpenForm "frmMyPopup", , , , , acDialog
or, using named arguments which are easier to read and less prone to
mistakes:
DoCmd.OpenForm "frmMyPopup", WindowMode:=acDialog

If you don't want the form to be modal (a rare occurrence) then you will
need to put DoCmd.Restore in the second form's Activate event procedure, and
DoCmd.Maximize in the first form's.

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand


.
 
Back
Top