How do I add data from three different fields in an Access form?

S

Suntayea

I am trying to add (sum) three fields on a form into another field using
=Sum(""[Content GPA],[Student Teaching Assessment],[Praxis II]"")
But I keep getting errors. I've moved many operations around and I can't get
the total right.

By the way, is it a problem that all of these fields are in the same table?
 
R

RBear3

In a new unbound field in your form simply put the following:

=[Content GPA]+[Student Teaching Assessment]+[Praxis II]
 
C

Carl Rapson

Suntayea said:
I am trying to add (sum) three fields on a form into another field using
=Sum(""[Content GPA],[Student Teaching Assessment],[Praxis II]"")
But I keep getting errors. I've moved many operations around and I can't
get
the total right.

By the way, is it a problem that all of these fields are in the same
table?

What errors are you getting? Are these fields contained in the table to
which the form is bound?

Carl Rapson
 
K

Klatuu

Use the Control names, not the field names. Also, for new record, it would
be best to include the Nz function for each control so the value will
increment as the controls are filled in. Otherwise, you will not see a value
until all 3 controls have values because Null + anything = Null.

=Nz(txtContentGPA,0)+Nz*txtStudentTeachingAssessment,0)+Nz(txtPraxisII,0)


--
Dave Hargis, Microsoft Access MVP


RBear3 said:
In a new unbound field in your form simply put the following:

=[Content GPA]+[Student Teaching Assessment]+[Praxis II]


--
Hope that helps!

RBear3
..

Suntayea said:
I am trying to add (sum) three fields on a form into another field using
=Sum(""[Content GPA],[Student Teaching Assessment],[Praxis II]"")
But I keep getting errors. I've moved many operations around and I can't
get
the total right.

By the way, is it a problem that all of these fields are in the same
table?
 
S

Suntayea

Thank you so much, after letting go of the thought all weekend. I finally
figured it out. :)

RBear3 said:
In a new unbound field in your form simply put the following:

=[Content GPA]+[Student Teaching Assessment]+[Praxis II]


--
Hope that helps!

RBear3
..

Suntayea said:
I am trying to add (sum) three fields on a form into another field using
=Sum(""[Content GPA],[Student Teaching Assessment],[Praxis II]"")
But I keep getting errors. I've moved many operations around and I can't
get
the total right.

By the way, is it a problem that all of these fields are in the same
table?
 
S

Suntayea

Thanks bunches!!

Klatuu said:
Use the Control names, not the field names. Also, for new record, it would
be best to include the Nz function for each control so the value will
increment as the controls are filled in. Otherwise, you will not see a value
until all 3 controls have values because Null + anything = Null.

=Nz(txtContentGPA,0)+Nz*txtStudentTeachingAssessment,0)+Nz(txtPraxisII,0)


--
Dave Hargis, Microsoft Access MVP


RBear3 said:
In a new unbound field in your form simply put the following:

=[Content GPA]+[Student Teaching Assessment]+[Praxis II]


--
Hope that helps!

RBear3
..

Suntayea said:
I am trying to add (sum) three fields on a form into another field using
=Sum(""[Content GPA],[Student Teaching Assessment],[Praxis II]"")
But I keep getting errors. I've moved many operations around and I can't
get
the total right.

By the way, is it a problem that all of these fields are in the same
table?
 
S

Suntayea

Thank you, I figured out the problems. I don't remember the errors now.

Carl Rapson said:
Suntayea said:
I am trying to add (sum) three fields on a form into another field using
=Sum(""[Content GPA],[Student Teaching Assessment],[Praxis II]"")
But I keep getting errors. I've moved many operations around and I can't
get
the total right.

By the way, is it a problem that all of these fields are in the same
table?

What errors are you getting? Are these fields contained in the table to
which the form is bound?

Carl Rapson
 
G

Gosha

HI

what if I want to have a field that sums others but I want the data form it
to be kept in the table as well (unbound field will only return the value -
wont save it anywhere...)???

Thanks
--
Gosha


RBear3 said:
In a new unbound field in your form simply put the following:

=[Content GPA]+[Student Teaching Assessment]+[Praxis II]


--
Hope that helps!

RBear3
..

Suntayea said:
I am trying to add (sum) three fields on a form into another field using
=Sum(""[Content GPA],[Student Teaching Assessment],[Praxis II]"")
But I keep getting errors. I've moved many operations around and I can't
get
the total right.

By the way, is it a problem that all of these fields are in the same
table?
 
L

Linq Adams via AccessMonster.com

Gosha said:
what if I want to have a field that sums others but I want the data form it
to be kept in the table as well

Calculated values very seldom need to be stored in a table. The general
method of addressing this is that you merely use the same expression

Nz(txtContentGPA,0)+Nz(txtStudentTeachingAssessment,0)+Nz(txtPraxisII,0)

in this case, to recalculate the data as needed, in reports, etc.

If there is a valid reason to store the result of the calculation, you have
to

Move the expression out of the Control Source for the textbox and place it in
the AfterUpdate event for each of the component textboxes:

txtContentGPA
txtStudentTeachingAssessment
txtPraxisII

An alternative, if your form is based on a query, would be to have a
Calculated field in your underlying query that does the same calculation,
then bind your results textbox to this calculated field.

Not that Dave has a typo in the expression he posted.

=Nz(txtContentGPA,0)+Nz*txtStudentTeachingAssessment,0)+Nz(txtPraxisII,0)

should be

=Nz(txtContentGPA,0)+Nz(txtStudentTeachingAssessment,0)+Nz(txtPraxisII,0)
 

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