Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: Setting Visible Property to False Does Not Hide Form


View products that this article applies to.

This article was previously published under Q208896
Novice: Requires knowledge of the user interface on single-user computers.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

↑ Back to the top


Symptoms

When you set a form's Visible property to False, the form is not hidden.

↑ Back to the top


Cause

The Database window is hidden, and the form's OnDeactivate property setting specifies a macro containing the Restore action.

↑ Back to the top


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.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

↑ Back to the top


More information

Steps to Reproduce Behavior

1.Start Microsoft Access and create a new database.
2.Create the following three new macros:
   Macro Name   Macro Actions    Action Arguments
   -----------------------------------------------------
   AutoExec     RunCommand       Command: WindowHide
                OpenForm         Form Name: Form1
   Restore      Restore
   Max          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:
Private Sub Command0_Click()
   Me.Visible = False
   DoCmd.OpenForm "Form2"
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.

↑ Back to the top


References

For more information about macros and how they work, click Microsoft Access Help on the Help menu, type macros: what they are and how they work in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

↑ Back to the top


Keywords: KB208896, kbnofix, kbbug

↑ Back to the top

Article Info
Article ID : 208896
Revision : 2
Created on : 6/29/2004
Published on : 6/29/2004
Exists online : False
Views : 266