Total Calculation

T

Terry

I have a Grand Tot Field that totals 14 other fields on a form. Works great
unless one of the fields is empty, in which case the calculation returns
nothing. I know that I can set the default value of the fields to 0 so that
does not happen, but I want the underlying table fields to remain empty if
the value would be 0, so setting the default is problematic.

Question - is there a way to calculate a sum of those fields if several of
them are empty?
Terry
 
K

Keith Wilby

Terry said:
I have a Grand Tot Field that totals 14 other fields on a form. Works great
unless one of the fields is empty, in which case the calculation returns
nothing. I know that I can set the default value of the fields to 0 so that
does not happen, but I want the underlying table fields to remain empty if
the value would be 0, so setting the default is problematic.

Question - is there a way to calculate a sum of those fields if several of
them are empty?
Terry

Yes, calculate the totals in a query and use the Nz (null-to-zero) function
to convert nulls into, erm, zeros!

Keith.
www.keithwilby.com
 

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