How to calculate the sum of the columns in a row

H

HMCBDS

I have one row with six columns with numbers in each column. I would like to
create a 7th column (grandtotal) that would calculate the sum of the previous
columns.

f01 thru f06

For example,

ID f01 f02 f03 f04 f05 f 06 grandtotal
1 100 200 300 400 500 600

What would be the code to be placed in the grandtotal column that would
generate the column sum.

Is that possible to be placed in the table.

Thank you,
 
A

Al Campagna

HMCBDS,
What would be the code to be placed in the grandtotal column that would
generate the "column" sum.
From your description, I think your looking for the Row Sum.
Using an unbound text control, give it a ControlSource of...
=F01+F02+F03+F04+F05+F06
You shouldn't be saving the resulting calculated value.
As a general rule... don't save a calculated value that can be
re-derived "on the fly" in any subsequent form, query, or report.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
D

Douglas J. Steele

<picky>
To handle cases where a particular field may have no value, it may be a good
idea to use the Nz function:

=Nz(F01,0)+Nz(F02,0)+Nz(F03,0)+Nz(F04,0)+Nz(F05,0)+Nz(F06,0)

</picky>
 

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