Microsoft KB Archive/99935

{|
 * width="100%"|

ACC1x: Hidden Subform Maximized If Main Form Is Maximized

 * }

Q99935

-

The information in this article applies to:


 * Microsoft Access versions 1.0, 1.1

-

SYMPTOMS
In a main/subform combination where the main form is maximized and the subform is hidden, the subform returns maximized when it is made visible. This results in covering the entire main form.

RESOLUTION
Because the Visible property is usually changed through a macro or function, work around this problem by adding steps to the process to restore the main form before the subform is made visible. Then, maximize the main form. An example of this workaround is detailed after the &quot;Steps to Reproduce Problem&quot; section below.

STATUS
This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION
You can reproduce this problem by using the Orders form in the NWIND.MDB sample database. The following steps detail the macros necessary to reproduce this problem. The resolution to this sample problem is listed after the steps.

Steps to Reproduce Problem
  Create a macro group that contains two macros. Name one &quot;Hidden&quot; and the other &quot;Visible.&quot;

     Macro Name         Action ---     Hidden             Setvalue Visible           Setvalue

Hidden Macro Actions Setvalue Item: Forms![orders]![orders subform].Form.Visible Expression: 0

Visible Macro Actions -     Setvalue Item: Forms![orders]![orders subform].Form.Visible Expression: -1  Close and save the macro as &quot;Show.&quot; Open the Orders form and add two command buttons.  Set the following properties on the command buttons:

    Command Button: Button1 Caption: Hide OnPush: Show.Hidden

Command Button: Button2 Caption: Show OnPush: Show.Visible  Choose View, then choose Form to open the Orders Form in Form view. Maximize the Orders form by using the Maximize button in the forms upper-right corner. Choose the Hide button to hide the subform.</li> Choose the Show button to show the subform maximized.</li></ol>

The main form is no longer visible.

To workaround this problem, change the Visible macro actions as follows:

<pre class="FIXEDTEXT">  Visible Macro Actions -  Echo Echo On: No  Restore Setvalue Item: Forms![orders]![orders subform].Form.Visible Expression: -1 Maximize Echo Echo On: Yes