Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum three text fields 1

Status
Not open for further replies.

JPimp

Technical User
Mar 27, 2007
79
US
I want to sum the total in 3 different text fields, but all I get is the concatenated total instead of a sum total.

Code:
Int32.Parse(TenMinuteSample.Text)
        Int32.Parse(ThirtyMinuteSample.Text)
        Int32.Parse(SixtyMinuteSample.Text)

        Dim TotalCount As Int32

        TotalCount = (TenMinuteSample.Text + ThirtyMinuteSample.Text + SixtyMinuteSample.Text)


Kai-What?
 
Just move the int32.parse:

Code:
Dim TotalCount As Int32
TotalCount = (Int32.Parse(TenMinuteSample.Text)
+ Int32.Parse(ThirtyMinuteSample.Text) + Int32.Parse(SixtyMinuteSample.Text))

mwa
<><
 
Thank you so much!! That works great!

Kai-What?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top