can't sum figures in a report ...help please

C

Carla

I have a text box that uses an if statement to determine whether someone is
absent in my class or not. I name the text box inattendance.

I have a text box called points that assigns points to absent students
depending on which class they are currently enrolled in.

I want to sum the total points for each student. I do a simple
=sum([points]) and when I run the report I get a box that just says points
indicating that it doesn't have a definition for points. I used the name
property of the text box and called it points.

any suggestions on alernate methods or on what I am doing wrong would be
appreciated

Thanks
 
J

John Spencer

You Sum the contents of FIELDS not the contents of CONTROLS.
Assuming the field in the table is named inAttendance then try:
=Sum([inAttendance])

Fields are the place where data is stored.
Controls are objects that can display the value of a field. On a form or in a
report you see controls of many types. Textbox controls usually display the
contents of a field (Control Source), but they can display the values of an
expression.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
C

Carla

I see the distinction now. Thanks for pointing that out. However, the points
are only generated on the report and aren't stored in a field. Is there a way
to sum them when they are not captured or held anywhere else?

the inattendance field only returns 'absent" or "present". I can easily get
ehttotal number of absences by doing what you suggested. I need to capture
the number of points assigned for the absence and sum them for each
individual student. Those points are what the text box called points
generates. Based on the ones saying absent then it assigns the correct number
of points.

the field where the points are generated is called points , but it only
exists on the report and no where else. Can I get that figure to be captured
somewhere else and then some it?

Thanks so much


Thanks so much for your input
John Spencer said:
You Sum the contents of FIELDS not the contents of CONTROLS.
Assuming the field in the table is named inAttendance then try:
=Sum([inAttendance])

Fields are the place where data is stored.
Controls are objects that can display the value of a field. On a form or in a
report you see controls of many types. Textbox controls usually display the
contents of a field (Control Source), but they can display the values of an
expression.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
I have a text box that uses an if statement to determine whether someone is
absent in my class or not. I name the text box inattendance.

I have a text box called points that assigns points to absent students
depending on which class they are currently enrolled in.

I want to sum the total points for each student. I do a simple
=sum([points]) and when I run the report I get a box that just says points
indicating that it doesn't have a definition for points. I used the name
property of the text box and called it points.

any suggestions on alernate methods or on what I am doing wrong would be
appreciated

Thanks
.
 
J

John Spencer

OK, so HOW do you calculate POINTS? For instance, if points is calculated
with an expression like
=IIF([inAttendance]="Present",0,2)
Then you sum the expression
= Sum(IIF([inAttendance]="Present",0,2))

And you still seem to be calling controls "fields". Please try to keep that
straight when posting, it does lead to confusion if you don't.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
I see the distinction now. Thanks for pointing that out. However, the points
are only generated on the report and aren't stored in a field. Is there a way
to sum them when they are not captured or held anywhere else?

the inattendance field only returns 'absent" or "present". I can easily get
ehttotal number of absences by doing what you suggested. I need to capture
the number of points assigned for the absence and sum them for each
individual student. Those points are what the text box called points
generates. Based on the ones saying absent then it assigns the correct number
of points.

the field where the points are generated is called points , but it only
exists on the report and no where else. Can I get that figure to be captured
somewhere else and then some it?

Thanks so much


Thanks so much for your input
John Spencer said:
You Sum the contents of FIELDS not the contents of CONTROLS.
Assuming the field in the table is named inAttendance then try:
=Sum([inAttendance])

Fields are the place where data is stored.
Controls are objects that can display the value of a field. On a form or in a
report you see controls of many types. Textbox controls usually display the
contents of a field (Control Source), but they can display the values of an
expression.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
I have a text box that uses an if statement to determine whether someone is
absent in my class or not. I name the text box inattendance.

I have a text box called points that assigns points to absent students
depending on which class they are currently enrolled in.

I want to sum the total points for each student. I do a simple
=sum([points]) and when I run the report I get a box that just says points
indicating that it doesn't have a definition for points. I used the name
property of the text box and called it points.

any suggestions on alernate methods or on what I am doing wrong would be
appreciated

Thanks
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top