PDA

Click to See Complete Forum and Search --> : Addition of two text boxes


BJK
Nov 26th, 1999, 12:55 AM
Could you please help, this I know is a simple problem but I can't get the answer to work. I have three text boxes (text1, text2, text3) and a command button. My application is when I press the command button I want text1 to add to text2 and result in text3 using the "+" key. The result I am getting is Text1Text2 beside themselves as if I was using a "&" key.
Please Help, thanks bjk

Juillet
Nov 26th, 1999, 01:00 AM
text boxes are text by nature
you need to perform functions on numbers

text3.text = Cint(Text1.txt) + Cint(Text2.txt)

JHausmann
Nov 26th, 1999, 10:44 AM
You might want to do a check to see if the field is numeric before converting it to an int. Text data might turn it into a Type 13 error...

Using "Val" might also give you the answer you want, IF you don't care to check.

smrenga
Nov 26th, 1999, 09:01 PM
).