ACC2: MS Access 2.0 Processes Properties First, Controls Second

Last reviewed: May 12, 1997
Article ID: Q118961
The information in this article applies to:
  • Microsoft Access version 2.0

SYMPTOMS

Unexpected behaviors occur on forms and reports when controls on forms and reports have the same names as properties.

CAUSE

In Microsoft Access version 2.0, the Microsoft Jet database engine processes references to properties first, and references to control names second.

RESOLUTION

The best solution is to make sure that control names do not match existing property names. You can see a complete list of property names by searching for "reserved words," and then "Programming Topics" using the Microsoft Access Help menu.

Another solution is to use the complete form or report reference for referring to controls on forms and reports. For information about control references, search for "referring to controls," and then "Referring to Controls on a Form or Report" using the Microsoft Access Help menu.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new, blank form in Microsoft Access version 2.0.

  2. Add a text box to the form. Set the text box's Name property to Visible, and its DefaultValue property to 0.

  3. Add a command button to the form. Set the command button's OnClick property to the following macro:

          Action: SetValue
          Item: [Visible]
          Expression: Not [Visible]
    

  4. View the form in Form view.

  5. Click the command button. Note that the entire form disappears, instead of just the Visible text box.

REFERENCES

For information about how the Name property is an exception to this rule when you are using an unconverted version 1.x database file in version 2.0, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q112130
   TITLE     : ACC: Using "Name" in Expressions
 

	
	


Keywords : kbusage TblDsign
Version : 2.0
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
Resolution Type : Info_Provided


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 12, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.