-
October 3rd, 2012, 02:19 PM
#1
[RESOLVED] How to calculate the total sum of the numbers
Hi guys, i need your help. I am beginner on this vb6 so i hope you can help me.
In Vb6 i create 1 Command button, 1 Label and 8 TextBox.
In Command button i wrote this code:
Command1_Click()
Label1 = Val(Text1) + Val(Text2) + Val(Text3) + Val(Text4) + Val(Text5) + Val(Text6) + Val(Text7) + Val(Text8)
In 8 TextBox for example i write date of birth: 1989 06 28 and then click command button. Then in label i see result 43. Now i need the number of 43 sum. ( 4 + 3 = 7).And if lets say number is 93 then 9 + 3 = 12 = 1 + 2 = 3.
I guess in vb6 code need write with If, Then, Else, End If arguments. For example:
If Label1 > 10 Then
Val(Text1) + Val(Text2)....
Else
EndIf
End sub
If you know how to calculate better, please help me.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|