Problem with extra increment of detail count across page breaks

  • Thread starter Thread starter Max Moor
  • Start date Start date
M

Max Moor

Hi All,
I have a report in which I'm keeping a running count in the detail
section. For some reason, I don't understand, the count gets incremented
when going to a new page. I have an OnRetreat event function, but it
doesn't seem to have any effect on this problem. Can someone enlighten me?

- Max
 
Totals collected through the events of the report are not accurate. Although
the Print and Retreat events (but not Format) should work if you take the
Count into account, you still have major problems if the user previews or
prints only some of the later pages in a report: the events for the
intervening pages may not fire at all, and so the accumulated total is
completely wrong.

If it's just a running count you need, add an extra text box to the Detail
section, and set its properties like this:
Control Source =[Amount]
Running Sum Over All
Format Currency
Name txtAmountRS
Visible No
where "Amount" is the name of the field to be aggregated, and Format
indicates to Access that this is a Numeric field (use "General Number" if
it's not currency).

You can now add a text box to the Report Footer section to show the result:
ControlSource =[txtAmountRS]

The Running Sum approach works correctly regardless of which pages are
viewed/printed.
 
Back
Top