Why Is Form Resized?

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.
 
J

Jeff Conrad

Hi,

Put this code in the Report's Close event:

DoCmd.Restore

Jeff Conrad
Access Junkie
Bend, Oregon
 
C

Chaplain Doug

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
 
J

Jeff Conrad

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
 
D

Dirk Goldgar

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.
 

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

Top