ACC97: Running Sum Produces Incorrect Results (303192)



The information in this article applies to:

  • Microsoft Access 97

This article was previously published under Q303192
Novice: Requires knowledge of the user interface on single-user computers.

SYMPTOMS

When you create a report that has the Detail section's Visible property set to No, and the Detail section contains a text box that displays a running sum, the first record at the top of each page may display incorrect results.

CAUSE

This behavior can occur if a text box in a group footer references the value of the running sum and the Keep Together property for that grouping is set to No.

RESOLUTION

To resolve this behavior, set the Keep Together property for the grouping to Whole Group:
  1. Click the OrderID field, and then on the Report Design toolbar, click Sorting and Grouping.
  2. In the Field/Expression box, click OrderID, and then in the Group Footer box, click Yes.
  3. In the Keep Together box, click Whole Group, and then quit the Sorting and Grouping dialog box.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Open the Northwind sample database, and then create a tabular AutoReport that is based on the Order Details table:
    1. In the Database window, click the Reports tab, and then click New.
    2. In the New Report dialog box, click AutoReport: Tabular, click the Order Details table in the box at the bottom of the dialog box, and then click OK.
  2. After the report is created, on the View menu, click Design View.
  3. In the Detail section, add a text box.
  4. Right-click the new text box, click Properties, and then click the Data tab.
  5. In the Control Source box, click UnitPrice, and then in the Running Sum box, click OverGroup.
  6. Click the Other tab, type RunSum in the Name box, and then close the Properties dialog box.
  7. Click the OrderID field, and then on the Report Design toolbar, click Sorting and Grouping.
  8. Click OrderID in the Field/Expression box, click Yes in the Group Footer box, and then quit the Sorting and Grouping dialog box.
  9. Click the Report Footer section, and then create two text boxes.
  10. Right-click the first text box, and then click Properties.
  11. Click the Data tab, type =[RunSum] in the Control Source box, and then quit the Properties dialog box.
  12. Right-click the second text box, and then click Properties.
  13. Click the Data tab, type =[UnitPrice] in the Control Source box, and then quit the Properties dialog box.
  14. Right-click the Detail section, and then click Properties.
  15. Click the Format tab, click No under Visible, and then close the Properties dialog box.
  16. Preview the report, and note that the first record on each page (except the first) produces an erroneous value in the text box that references the RunSum text box.

Modification Type:MajorLast Reviewed:2/5/2006
Keywords:kbprb kbui KB303192