=sum() in report textbox

  • Thread starter Thread starter w1nta
  • Start date Start date
W

w1nta

Guest
I'm a noob and may be barking up the wrong tree so feel free to say so....

I have an access 2003 DB that keeps track of student suspensions in a secondary college. The forms are working well but I'm stuck on the reports. A report is to notify the parent of the incident and action taken and the feature I'm having trouble with is adding a count to the report that lists the total number of days the student has been suspended. This is a simple table that has the student code and dates of suspension and the SchoolDays field contains the number of days suspended for each incident.

On my report layout I have a text box whos Control Source is
=Sum([tblSuspension].[SchoolDays])
which works fine but that displays the total days suspended of all students. I need days suspended by a particular student. What I would like to be able to use is, =Sum([tblSuspension].[SchoolDays] where [tblSuspension].[Stud_ID] = <ID of the student for this report>)

Any help is much appreciated.
 

Attachments

  • Image1.jpg
    Image1.jpg
    38.1 KB · Views: 195
Last edited:
Open the Sorting and Grouping dialog box, under Field/Expression select Student_ID, Group Footer set to Yes
Place the line "Total Days Suspended [= Sum([SchoolDays])]" under the Student_ID Group Footer
 

Users who are viewing this thread

Back
Top Bottom