Simply summing text boxes

XaloRichie

Registered User.
Local time
Today, 05:16
Joined
Jul 2, 2003
Messages
70
I have a form with 8 textboxes which are unbound and have calculated values. Can I sum them. eg text1 to text8?

How?
 
In the ControlSource:

=[Text1]+[Text2]+[Text3]+[Text4]+[Text5]+[Text6]+[Text7]+[Text8]
 
OK If I have to

So I can't use Sum and a range or anything ?

Im sure I once used something like that in VB5.

OK it will have to be the +'s

Ta!
 
Richie,

Are all the entries in the textboxes valid numbers? And check
to make sure that the textbox that you are summing them
into has a format of number.

Wayne
 
If any of your text boxes can be null, the formula will fail. If this is a possibility and you want to treat a null as a valid entry use the NZ() function to turn the null into a number (presumably 0)
 
Might as well add that, sometimes if (by some way or another) the two values in textboxes seem numerical but are in fact text such as "32" and "67" then adding these doesn't actually give you 99, but "3267". Yes, sometimes numbers are concatenated so another useful function can be Val().

ie.

=Val(Nz([txtMyText]))
 
That will also return 0 if the textbox has a value of 0 or has the NZ function around it.
 

Users who are viewing this thread

Back
Top Bottom