Calculations with some fields empty

  • Thread starter Thread starter Anthony
  • Start date Start date
A

Anthony

Hi,
I have a form that has several fields that contain prices but sometimes i
dont use them all, the problem i have is i can get it to add all the fields
as long as all the fields have a number in them but not when one or more
fields or null.
Does anybody know of an alternative to make the 'total' field add all the
fields treating the null fields as 0.

The code i've been trying is setting the control source of the 'total' text
field as: =[amount1]+[amount2]+[amount3] etc.

Thanks guys in advance.
 
Use the Nz() function to tell Access to use a zero for Null:

=Nz([amount1],0) + Nz([amount2,0) + Nz([amount3],0)
 
Thanks Allen saved me a lot of time......would you believe i have your old
site at bigpond in my favourites.......i've updated the favourite...thanks
again...
 
Back
Top