DCount in Reports

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

Guest

Hi,
I have a report that shows each students result as a pass or fail in each
of there subject. the report is grouped by student. I need to do a count
that counts how many passess and how many fails each student has overall.
This is put into the student footer, i have tried using Dcount for this but
am unsure of how to set the controlsource to the information in the detail
section of the report. I have set the controlsource to the table but ofcourse
this gives me the total fails and passes overall students and subjects
instead of the individual students subjects.

eg
=dcount("[studentscore]","tablename--thisisn'tworking","[studentscore]='pass'")
I get 53 passes which is all passes over all students and subjects instead
of 3 passes for student1 over 4 subjects.

any help would be much appreciated
thanks
 
rather than going back to the table to retrieve info that is already
available in the report, try this for the "total passes" textbox in the
student footer, as

=Sum(IIf([studentscore]="pass", 1, 0))

and this for the "total fails" textbox in the student footer, as

=Sum(IIf([studentscore]="fail", 1, 0))

hth
 
you're welcome :)


Tanya said:
Thanks that worked perfectly :-D

Tanya said:
Hi,
I have a report that shows each students result as a pass or fail in each
of there subject. the report is grouped by student. I need to do a count
that counts how many passess and how many fails each student has overall.
This is put into the student footer, i have tried using Dcount for this but
am unsure of how to set the controlsource to the information in the detail
section of the report. I have set the controlsource to the table but ofcourse
this gives me the total fails and passes overall students and subjects
instead of the individual students subjects.

eg
=dcount("[studentscore]","tablename--thisisn'tworking","[studentscore]='pass
'")
I get 53 passes which is all passes over all students and subjects instead
of 3 passes for student1 over 4 subjects.

any help would be much appreciated
thanks
 
I have spent about two days trying to figure a similar situation out and that
code helped. Tina you are AWESOME thank you so much!

tina said:
you're welcome :)


Tanya said:
Thanks that worked perfectly :-D

Tanya said:
Hi,
I have a report that shows each students result as a pass or fail in each
of there subject. the report is grouped by student. I need to do a count
that counts how many passess and how many fails each student has overall.
This is put into the student footer, i have tried using Dcount for this but
am unsure of how to set the controlsource to the information in the detail
section of the report. I have set the controlsource to the table but ofcourse
this gives me the total fails and passes overall students and subjects
instead of the individual students subjects.

eg
=dcount("[studentscore]","tablename--thisisn'tworking","[studentscore]='pass
'")
I get 53 passes which is all passes over all students and subjects instead
of 3 passes for student1 over 4 subjects.

any help would be much appreciated
thanks
 
you're welcome too! :)


Andrew Snyder said:
I have spent about two days trying to figure a similar situation out and that
code helped. Tina you are AWESOME thank you so much!

tina said:
you're welcome :)


Tanya said:
Thanks that worked perfectly :-D

:

Hi,
I have a report that shows each students result as a pass or fail in each
of there subject. the report is grouped by student. I need to do a count
that counts how many passess and how many fails each student has overall.
This is put into the student footer, i have tried using Dcount for
this
but
am unsure of how to set the controlsource to the information in the detail
section of the report. I have set the controlsource to the table but ofcourse
this gives me the total fails and passes overall students and subjects
instead of the individual students subjects.

eg
=dcount("[studentscore]","tablename--thisisn'tworking","[studentscore]='pass
'")
I get 53 passes which is all passes over all students and subjects instead
of 3 passes for student1 over 4 subjects.

any help would be much appreciated
thanks
 
Back
Top