Adding Multiple Fields

  • Thread starter Thread starter dcrqueens
  • Start date Start date
D

dcrqueens

I am trying to add 3 fields in a form using an unbound text box as follows:
=Nz(RES,0)+(Nz(CRE,0). The formula simply takes what is in the field and puts
them together in the unbound text box. So if there is the following RES 2,
CRE 3, I get 23 in the unbound text box. Can someone please tell me when I am
going wrong?
 
If 2 + 3 = 23, then you want concatenation, not addition.

Try & as the concatenation operator:
=[RES] & [CRE]
 
I am trying to add 3 fields in a form using an unbound text box as follows:
=Nz(RES,0)+(Nz(CRE,0). The formula simply takes what is in the field and puts
them together in the unbound text box. So if there is the following RES 2,
CRE 3, I get 23 in the unbound text box. Can someone please tell me when I am
going wrong?

It's treating the values as text strings (for which + is a concatenation
operator) rather than as numbers. Try

=Val([Res]) + Val([CRE])
 
When I place an unbound textbox on a form, I have to be sure that all the
fields are numbers or currency if summation is what I want. If RES and CRE
are defined as text strings but you store numbers in them then convert the
text, e.g., 2, 4, or 9 to numbers and see if that works.

HTH

David
 
dcrqueens said:
I am trying to add 3 fields in a form using an unbound text box as follows:
=Nz(RES,0)+(Nz(CRE,0). The formula simply takes what is in the field and
puts
them together in the unbound text box. So if there is the following RES 2,
CRE 3, I get 23 in the unbound text box. Can someone please tell me when I
am
going wrong?

Sounds like an Abbott & Costello routine. What's happening is that you are
adding text. "2"+"3" = 23 If necessary, try forcing the numerics:

= CDbl(Nz(RES,0))+CDbl(Nz(CRE,0))
 
Back
Top