add numbers in textboxes on userform
Kimberly,
What's in the textboxes is a string.
You have to convert them to numbers before adding them.
e.g.
me.textbox5= cDbl(textbox1) + cDbl(textbox2)
etc.
John
KimberlyC wrote:
Hi!
I have textbox1, textbox2, textbox3, textbox4, and textbox5 on a userform.
I'm trying to add textbox1, textbox2, textbox3, and textbox4 and place the
sum (total) in Textbox5.
I've tried the following code attached to a command button:
me.textbox 5= (textbox1 + textbox2+ textbox3 + textbox4)
I keep getting the error message that textbox4 member or data cannot be
found. I've double check the spelling of the names and they are correct. If
I remove Textbox4 from the code, then the error states it cannot find
textbox3 member or data.
What am I doing wrong??
Thanks in advance for your help!!!
Kimberly
|