Why Is Form Resized?

  • Thread starter Thread starter Chaplain Doug
  • Start date Start date
C

Chaplain Doug

Access 2002. I have a main form called Reports. This
form opens another form to ask for input regarding a
report. Both the main form and the "report criteria" form
open maximized. Once the input is provided on the report
criteria form, the form opens the report. When I close
the report both of my forms have been reduced and
centered. How may I fix it so that the forms remain in
the same position and size they were when opened? Thanks.
 
Hi,

Put this code in the Report's Close event:

DoCmd.Restore

Jeff Conrad
Access Junkie
Bend, Oregon
 
I did this but still have the problem. My forms are set
to AutoResize=No and AutoCenter=No. Why are they still
being resized and repositioned? Thanks
 
Humm...that's weird. Never had that problem.
There could possibly be some other code in the two forms or the report causing this, but
I'm not sure.

Try adding a DoCmd.Maximize to each form's Activate event:

Private Sub Form_Activate()
DoCmd.Maximize
End Sub

Jeff Conrad
Access Junkie
Bend, Oregon
 
Chaplain Doug said:
Access 2002. I have a main form called Reports. This
form opens another form to ask for input regarding a
report. Both the main form and the "report criteria" form
open maximized. Once the input is provided on the report
criteria form, the form opens the report. When I close
the report both of my forms have been reduced and
centered. How may I fix it so that the forms remain in
the same position and size they were when opened? Thanks.

You say your forms are maximized when you open the report. Is the
report also maximized when it opens, then? I'd expect it to be. If it
isn't, either you are restoring it yourself or you have code to restore
it in some report event. But the maximized state of the Access client
windows, whether form or report, is universal -- either all are
maximized, or all are restored. So if the report window is restored,
the form windows will be, too. You must either (a) not restore the
report window, or (b) call DoCmd.Restore in the report's Close event, or
(c) as Jeff Conrad suggests, call DoCmd.Maximize in the forms' Activate
events.
 
Back
Top