Microsoft KB Archive/119805

= ACC2: Expression Builder Creates Incorrect Section Syntax =

Article ID: 119805

Article Last Modified on 6/25/2002

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition

-



This article was previously published under Q119805



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



SYMPTOMS
When you use the Expression Builder to refer to a form or report's Section property, the syntax created by the Expression Builder is incorrect.



CAUSE
The Expression Builder incorrectly references sections as if they were controls on the form or report.



RESOLUTION
To reference a form or report's Section property, create the expression manually instead of using the Expression Builder.



STATUS
Microsoft has confirmed this to be a problem in Microsoft Access version 2.0. This problem no longer occurs in Microsoft Access version 7.0.



Steps to Reproduce Problem
 Add a command button to the form header section of any form. In the command button's OnClick property field, choose the Build button. In the Choose Builder box, select Code Builder, and then choose OK. Choose the Build button on the form module's toolbar. In the Expression Builder, select Detail in the second column, and Visible in the third column, and then choose the Paste button.</li> Choose the "=" button, and then type 0. The expressions should read as follows:

Me![Detail].Visible = 0 </li> Choose OK.</li> Close the form module, and then view the form in Form view.</li> Choose the new command button. Note that you receive the error message:

Invalid reference to field 'Detail'

The correct expression should read as follows:

Me.Section(0).Visible = 0

</li></ol>

<div class="references_section">