ACC: Setting Visible Property to False Does Not Hide Form

Last reviewed: May 14, 1997
Article ID: Q121899
2.0 7.0 97 WINDOWS kbusage

The information in this article applies to:

  • Microsoft Access versions 2.0, 7.0, 97

SYMPTOMS

Novice: Requires knowledge of the user interface on single-user computers.

When you set a form's Visible property to False, the form is not hidden if the Database window is also hidden and the form's OnDeactivate property setting specifies a macro containing the Restore action.

RESOLUTION

To hide the form, either remove the Restore action from the macro specified in the form's OnDeactivate property, or do not hide the Database window.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access 2.0, 7.0, and 97. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

  1. Start Microsoft Access and create a new database.

  2. Create the following three new macros:

    For Microsoft Access 97:

          Macro Name   Macro Action
          -------------------------
          AutoExec     RunCommand
                       OpenForm
          Restore      Restore
          Max          Maximize
    
          AutoExec Actions
          ----------------------
          RunCommand
             Command: WindowHide
          OpenForm
            Form Name: Form1
    
          Restore Actions
          ---------------
          Restore
    
          Max Actions
          -----------
          Maximize
    
        For Microsoft Access version 2.0 and 7.0:
    
          Macro Name   Macro Action
          -------------------------
          AutoExec     DoMenuItem
                       OpenForm
          Restore      Restore
          Max          Maximize
    
          AutoExec Actions
          ----------------
          DoMenuItem
             Menu Bar: Database
             Menu Name: Window
             Command: Hide
          OpenForm
            Form Name: Form1
    
          Restore Actions
          ---------------
          Restore
    
          Max Actions
          -----------
          Maximize
    
    

  3. Create a new, blank form.

  4. Add a command button to the form and set the button's OnClick property to the following event procedure:

          Sub Button0_Click ()
          Me.Visible = False
          DoCmd.Openform "Form2"   'Use this line in Microsoft Access 7.0
                                   'and 97
          DoCmd OpenForm "Form2"   'Use this line in Microsoft Access 2.0
          End Sub
    
    

  5. Set the following properties for the form:

          OnDeactivate: Restore
          OnActivate: Max
    

  6. Save the form as Form1.

  7. Create another new, blank form. Save the new form as Form2.

  8. Close the database and then open it. Note that Form1 is opened automatically.

  9. Click the command button on the form. Note that Form2 is opened, but Form1 is not hidden.

REFERENCES

For more information about macros, search the Help Index for "macros," and then "creating," or ask the Microsoft Access 97 Office Assistant.


Keywords : FmsProp kbusage
Version : 2.0 7.0 97
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: May 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.