|
-
Jul 7th, 2000, 10:29 PM
#1
Thread Starter
Junior Member
how do you set a text box to keep a running total of a the total value of the numbers in a couple of other text boxes.
-
Jul 7th, 2000, 10:46 PM
#2
Code:
Text1.text = Len(Text2.text)
This will keep a word count writing to text1 of how many words are in text2.
-
Jul 7th, 2000, 11:10 PM
#3
Fanatic Member
And this will add three textboxes together (as the user types) and it will add the result to the fourth textbox
Code:
Option Explicit
Private Sub Text2_Change()
Text1 = Val(Text2) + Val(Text3) + Val(Text4)
End Sub
Private Sub Text3_Change()
Text1 = Val(Text2) + Val(Text3) + Val(Text4)
End Sub
Private Sub Text4_Change()
Text1 = Val(Text2) + Val(Text3) + Val(Text4)
End Sub
-
Jul 8th, 2000, 12:52 PM
#4
adam3000 how do you set a text box to keep a running total of a the total value of the numbers in a couple of other text boxes.
Oops, didn't see the value part . Anyway, what does Val() do?
Val() = Returns the numbers contained in a string.
Anyone care to explain more?
-
Jul 8th, 2000, 01:49 PM
#5
transcendental analytic
Try put this in a immediate window
?val(" 1 2 345 6.7 8,9 hsfg h 56 34")
You'll notice that Val searches for the number's, ignores spaces, stops whenever it finds other characters, only accepts "." as decimal separator
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 8th, 2000, 11:34 PM
#6
Thread Starter
Junior Member
I had just figured that out but wasen't sure if that was the best way to do it. now i know. Thanks.
Originally posted by QWERTY
And this will add three textboxes together (as the user types) and it will add the result to the fourth textbox
Code:
Option Explicit
Private Sub Text2_Change()
Text1 = Val(Text2) + Val(Text3) + Val(Text4)
End Sub
Private Sub Text3_Change()
Text1 = Val(Text2) + Val(Text3) + Val(Text4)
End Sub
Private Sub Text4_Change()
Text1 = Val(Text2) + Val(Text3) + Val(Text4)
End Sub
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
|