Help with RunningSum in Reports

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

Guest

I use Access-2000 on Windows-XP,SP2.

I have several reports in a database showing, in the Report Footer, total
number of records fetched in and displayed in the Report Detail. For this, I
have a hidden text field "Record_Count" in the Report Detail with its Control
Source property set to "=1" and Running Sum property set to "Over All", and
another text field in the Report Footer with its Control Source property set
to "=[Record_Count]".

This works fine except when are is no record in the report - the Report
Footer's text field still shows Running Sum as "1". When I unhide the Report
Details's text field to debug, it shows as "1" even when there is no record
fetched.

It is a bug in Access or am I doing something wrong? Any
suggestions/fixes/corrections?

Thanks a lot!
 
Why are you using the running sum when you should be able to use:
=Count(*)
If your report might not return records, use:
=IIf(HasData = True, Count(*),0)
 
I use Access-2000 on Windows-XP,SP2.

I have several reports in a database showing, in the Report Footer, total
number of records fetched in and displayed in the Report Detail. For this, I
have a hidden text field "Record_Count" in the Report Detail with its Control
Source property set to "=1" and Running Sum property set to "Over All", and
another text field in the Report Footer with its Control Source property set
to "=[Record_Count]".

This works fine except when are is no record in the report - the Report
Footer's text field still shows Running Sum as "1". When I unhide the Report
Details's text field to debug, it shows as "1" even when there is no record
fetched.

It is a bug in Access or am I doing something wrong? Any
suggestions/fixes/corrections?


Neither. That is the expected behavior.

You have a text box with a constant expression (=1) and it
will display whether there are records or not. Actually
this is very useful in unbound reports.

You can make it display a zero instead, if that would be
preferable, by using:
=IIf(Report.HasData, 1, 0)

Or, if the running count in the detail section is not
important, you can use the expression =Count(*) in a report
footer text box.
 
Back
Top