Microsoft KB Archive/115877

= ACC2: RunningSum Text Box in Report Not Accumulating Values =

Article ID: 115877

Article Last Modified on 6/25/2002

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition

-



This article was previously published under Q115877



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



SYMPTOMS
When a text box in a report that uses the RunningSum property is based on another control in the report, it does not accumulate the running sum. Instead, it reflects only the value of the control it references.



RESOLUTION
Change the reference to use the Val function to convert the data type from Variant to Number, or reference a field from the underlying table or query.



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



MORE INFORMATION
This problem is usually encountered in databases that have been converted from version 1.x to 2.0.

Steps to Reproduce Problem
 Start Microsoft Access and open the sample database NWIND.MDB. Create a new report based on the Products table. Add two new text boxes side by side to the report's detail section. Note that the Name property of the left text box is Field0, and the right text box is Field2.  Set the following properties for the text boxes:

     Name: Field0 ControlSource: =[Unit Price]

Name: Field2 ControlSource: =[Field0] RunningSum: Over All  Preview the report and scroll to the last page.</li></ol>

Note that the Field2 text box reflects only what is contained in the Field0 text box, even though its RunningSum property is set to Over All. It does not accumulate the values contained in the two text boxes as it should.

To correct this problem for fields in the underlying record set, set the Field2 text box's ControlSource property to

<pre class="fixed_text">  =[Unit Price]

or use the Val function as in the following example:

<pre class="fixed_text">  =Val([Field0])

Note that this does not correct the problem for expression fields such as DLookup and Sum. You can also try placing the expression in the underlying query or incrementing a global variable using Access Basic.

<div class="references_section">