If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Adding Multiple Fields
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? |
#2
|
|||
|
|||
Adding Multiple Fields
If 2 + 3 = 23, then you want concatenation, not addition.
Try & as the concatenation operator: =[RES] & [CRE] -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "dcrqueens" wrote in message ... 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? |
#3
|
|||
|
|||
Adding Multiple Fields
On Wed, 28 Oct 2009 17:24:11 -0700, dcrqueens
wrote: 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]) -- John W. Vinson [MVP] |
#4
|
|||
|
|||
Adding Multiple Fields
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" wrote: 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? |
#5
|
|||
|
|||
Adding Multiple Fields
"dcrqueens" wrote in message ... 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)) -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com |
#6
|
|||
|
|||
Adding Multiple Fields
Thank you all. I was able to get the field to work. I used
=Nz(RES,0)+(Nz(CRE,0). "Arvin Meyer [MVP]" wrote: "dcrqueens" wrote in message ... 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)) -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com . |
Thread Tools | |
Display Modes | |
|
|