ACC1x: Hidden Subform Maximized If Main Form Is Maximized

Last reviewed: June 9, 1997
Article ID: 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 "Steps to Reproduce Problem" 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

  1. Create a macro group that contains two macros. Name one "Hidden" and the other "Visible."

          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
    
    

  2. Close and save the macro as "Show."

  3. Open the Orders form and add two command buttons.

  4. Set the following properties on the command buttons:

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

  5. Choose View, then choose Form to open the Orders Form in Form view.

  6. Maximize the Orders form by using the Maximize button in the forms upper-right corner.

  7. Choose the Hide button to hide the subform.

  8. Choose the Show button to show the subform maximized.

The main form is no longer visible.

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

   Visible Macro Actions
   ---------------------
   Echo
      Echo On: No
   Restore
   Setvalue
      Item: Forms![orders]![orders subform].Form.Visible
      Expression: -1
   Maximize
   Echo
      Echo On: Yes

REFERENCES

Microsoft Access "User's Guide," Chapter 22, "Using Macros with Forms"


Keywords : FmsSubf kbusage
Version : 1.0 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 9, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.