Microsoft KB Archive/120729

From BetaArchive Wiki

PRA: RunningSum Property Calculates Incorrect Values

Article ID: Q120729
Creation Date: 19-SEP-1994
Revision Date: 07-NOV-1996 The information in this article applies to:

  • Microsoft Access version 2.0

SYMPTOMS


Moderate: Requires basic macro, coding, and interoperability skills.

If a text box's ControlSource property setting specifies an Access Basic function, the value calculated by the text box's RunningSum property will not be correct.

RESOLUTION


There are two workarounds for this problem:

  • Change the function specified in the text box's ControlSource property by adding 0 (zero). For example, change

          ControlSource: =RunningTest()

    to:

          ControlSource: =RunningTest() + 0

    - or -

  • Specify a query, instead of the Access Basic function, in the text box's ControlSource property setting. Place the Access Basic function in the Field row in the query grid, and then use the query as the report's record source.

STATUS

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

MORE INFORMATION


Steps To Reproduce Problem


  1. Open the sample database NWIND.MDB and create a new module. Enter the following sample function in the module:

          Function RunningTest()
            RunningTest = 8
          End Function
  2. Create a blank new report based on the Orders table.
  3. From the View menu, choose Sorting And Grouping.
  4. In the first Field/Expression row, select Employee ID.
  5. Add the following three text boxes in the report's detail section:

          Name: Test1
             ControlSource: = RunningTest()
             RunningSum: No
          Name: Test2
             ControlSource: = RunningTest()
             RunningSum: Over Group
          Name: Test3
             ControlSource: = RunningTest()
             RunningSum: Over All
  6. Preview the report. Note that the values in the report do not increase cumulatively, as you expect.

REFERENCES

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

Microsoft Access "User's Guide," version 2.0, Chapter 21, "Designing Reports," pages 529-580



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.

©1997 Microsoft Corporation. All rights reserved. Legal Notices.


Additional reference words: 2.00
KBCategory: kbusage
KBSubcategory: FmrProb