ACC2: RunningSum Text Box in Report Not Accumulating Values

ID: Q115877


The information in this article applies to:


SYMPTOMS

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

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


  1. Start Microsoft Access and open the sample database NWIND.MDB.


  2. Create a new report based on the Products table.


  3. 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.


  4. Set the following properties for the text boxes:
    
          Name: Field0
            ControlSource: =[Unit Price]
    
          Name: Field2
            ControlSource: =[Field0]
            RunningSum: Over All 


  5. Preview the report and scroll to the last page.


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

   =[Unit Price] 

or use the Val() function as in the following example:

   =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.


REFERENCES

For more information about the RunningSum property, search for "RunningSum," and then "RunningSum Property" using the Microsoft Access Help menu.

Additional query words: reports


Keywords          : kbusage RptTotal 
Version           : 2.0
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: April 3, 1999