Display a running total in the report header

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a report with a group section on persons and a detail section about
their child records. In the group section, I put a calculated field (=1) with
a running sum so at the last group section record, I get the total number of
records (the number of DISTINCT persons).
How can I get to display that number in the first page header?
I tried "=[TheCalculatedField]" but I get "1" as an answer.
I tried to remove the running sum in the group section and, in the header,
the formula "=Sum([TheCalculatedField])" but I get an error.
I read the post at http://allenbrowne.com/casu-10.html, but I need a bit more.
Thanks.
 
Since nobody answered my question, I had to find a solution by myself. What I
did works but seems somewhat complicated to me. Here is how I did it. Any
comments will be appreciated.
I used a parameters table where I inserted a field called NumberOfRecords.
On the OK button code of the parameters screen, I create a SQL query of the
type "SELECT DISTINCT..." according to the user's preferences. Then, I get
the number of records from the recordset and update the parameters table. All
I have to do then is to add the value of this field in my report header.
I used that way of doing in many reports and they all produce correct totals.
I hope that helps someone in some way.
 
Back
Top