Count all records

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

Guest

I have a report that displays students by grade level. It calculates total
number of students by grade, but I need to get a grand total (for the the
whole school) in the report footer. I've tried a few things, but I keep
getting an Error message...or counts the total number of grades..13.

Thanks for any and all your help!
 
I have found that DCount works great for this. Assuming the text box that is
going to display the result is in the header or footer, set it's control
source to the following:
=DCount("*","[STUDENTS]")

[STUDENTS] is the table that contains the full listing of all of the
students in the school. This is assuming that all of the students are indeed
stored in one table and there is a field within that table that defines what
grade the student is in.

The "D Family of Functions" is very useful anytime you need a calculation
done with data that is outside of the source data for that report. In other
words, if your report is based upon a query for its data to give you all of
the detailed information on fourth grade, but you want to compare those
scores against the entire school, used a "D" function (DAvg, DLookup, DCount)
to pull up the value for the school that you want to use in the report. I
hope this helps. I'm entirely self taught (with a lot of help from the MVPs
here), but I think that should solve your problem.

Good luck,
Cevin Moses
 
Back
Top