Microsoft KB Archive/118961

= ACC2: MS Access 2.0 Processes Properties First, Controls Second =

Article ID: 118961

Article Last Modified on 11/6/2000

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition

-



This article was previously published under Q118961



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.



Steps to Reproduce Behavior
 Create a new, blank form in Microsoft Access version 2.0. Add a text box to the form. Set the text box's Name property to Visible, and its DefaultValue property to 0.  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]  View the form in Form view. Click the command button. Note that the entire form disappears, instead of just the Visible text box.</li></ol>

<div class="references_section">