Reset the form size

  • Thread starter Thread starter Ali
  • Start date Start date
A

Ali

I have a form where the window is set to fit form. The user can click a
button on the form and open a report - this uses the following code

callingform.visible = false
DoCmd.OpenReport "reportname", acViewPreview
DoCmd.Maximize

In the onClose event of the report I have the following code

forms!callingform.visible = true

However, the problem with this is that when the form opens it to is
maximised.
How can I reset this to its size before calling the report?
 
Ali said:
I have a form where the window is set to fit form. The user can click a button
on the form and open a report - this uses the following code

callingform.visible = false
DoCmd.OpenReport "reportname", acViewPreview
DoCmd.Maximize

In the onClose event of the report I have the following code

forms!callingform.visible = true

However, the problem with this is that when the form opens it to is maximised.
How can I reset this to its size before calling the report?

Move your DoCmd.Maximize to the Report's Open event and then add to the Report's
Close event...

DoCmd.Restore

The former is not required, but I think it cleaner to have both the Maximize and
Restore code in the same object.
 
DoCmd.Restore


|I have a form where the window is set to fit form. The user can click a
| button on the form and open a report - this uses the following code
|
| callingform.visible = false
| DoCmd.OpenReport "reportname", acViewPreview
| DoCmd.Maximize
|
| In the onClose event of the report I have the following code
|
| forms!callingform.visible = true
|
| However, the problem with this is that when the form opens it to is
| maximised.
| How can I reset this to its size before calling the report?
|
|
 
Thanks
Rick Brandt said:
Move your DoCmd.Maximize to the Report's Open event and then add to the
Report's Close event...

DoCmd.Restore

The former is not required, but I think it cleaner to have both the
Maximize and Restore code in the same object.
 
Back
Top