Link to home
Start Free TrialLog in
Avatar of mlcktmguy
mlcktmguyFlag for United States of America

asked on

Total For Two Fields On a bound form

The user has requested a total of two fields on a form bound to a table (tblAccountInfo)

The fields are PrincipalAmt and InterestAmt.

T o create the total fields I copy and pasted the InterestAmt field.

I then replaced the control source with several variations of 'PrincipalAmt + InterestAmt' in one even included and = first  '=PrincipalAmt + InterestAmt'

NO matter what I've tried I get the #Name in the field when the form is displayed.

What is the magic combination to get a total for these two fields on the screen?
ASKER CERTIFIED SOLUTION
Avatar of kevinrea
kevinrea
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
You will also probably want to wrap each Field with Nz(), in case one of the values is Null and the other is not:

=Nz([PrincipalAmt],0) + Nz([InterestAmt],0)

This will avoid 'Null Propagation'

mx
Avatar of mlcktmguy

ASKER

Yep, that was the magic combo, enclosing each field in brackets