Calculating Totals on a Form

Virginia

Registered User.
Local time
Today, 01:23
Joined
Nov 16, 2000
Messages
10
Hello all,
I'm trying to calculate a total on a form:
Field D = Field A - Field B - Field C
This calculation will only work if I enter all fields (A, B, and C). I would like to have Field D showing a result regardless if the user enters all three fields or only two, or only one. Right now if I don't enter all three fields, field D is blank. For instance if I enter $100.00 on field A and $50.00 on field B, I would like to have field D showing the result $50.00. Right now it only shows the result if I enter $100.00 on A, $20.00 on B, and $30.00 on C. In addition, if the user enters just the credit amount -$100.00 on field A, is it possible to have field D showing the reverse amount (debit $100.00) if no amounts were entered on either B or C? Can anyone help? I don't know if my explanation is too confusing. Any help is greatly appreciated.
 
The problem is with NULLS

Use this expression.

[Field D]=nz([Field A])-nz([Field B])-nz([Field C])

'The nz() function changes any null or "empty" values to 0

Duane Barker


[This message has been edited by BarkerD (edited 01-15-2001).]
 
Works great! Is there a way I can bind the end result (Field D) back to the table?
Thanks for your help!
 

Users who are viewing this thread

Back
Top Bottom