Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Totaling in a table

Status
Not open for further replies.

jetski

Technical User
Aug 12, 2003
5
0
0
US
I can get several fields totaled within my form. I do have a field for total in my table. How to I get the total reflected in my table?

Thanks jetski
 
It is generally a mistake to put a sum field in a record. Values can get changed without updating the sum field and the user may not know which is right. If you are using a form, use an unbound textbox and set the value to

me.text0 = val(me.field1) + val(me,field2) +val(me.field3)

Notice I use a val() in front of the rields. ACCESS uses text boxes. Using a textbox if text0 value is "1" then text0 + text0 = "11"

Do not make the compiler guess your intentions. Use str() and val() to make them clear.

You and also force a query to show a sumfield.

"SELECT [field1], [field2], ([Field1] + [field2]) as [TotField] FROM MyTable;


Rollie E
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top