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...
 

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

Similar Threads

Insert empty numeric value 3
Simple Calculation 2
format phone field 2
Help with Formula 1
Calculated Field 2
Unbound field calculation save in table 3
Check for empty fields 2
Calculated Field values question 1

Back
Top