Reset the form size

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?
 
R

Rick Brandt

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

DebbieG

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?
|
|
 
A

Ali

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.
 

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