|
-
Nov 3rd, 2002, 01:26 PM
#1
Thread Starter
Addicted Member
Stupid Question
This is a stupid question.....but I have put some code inside a text box which I want to make the contents of the text box change immediately depending one what else is happening on the form.
Makes no sense? Heres the code, I know it must be so obvious...
VB Code:
Option Explicit
Dim TOTAL As Double
Dim LINES As Integer
Private Sub txttotal_Change()
LINES = txtlines.Text
If cmoperms.Text = "10p" Then
TOTAL = ("0.10") * LINES
End If
txttotal.Text = TOTAL
End Sub
Im gonna hit myself when I find out the answer.....
-
Nov 3rd, 2002, 01:28 PM
#2
Stuck in the 80s
Shouldn't put this code in the Change event of the other TextBoxes so that when THEY change, the contents of txtTotal will be updated?
-
Nov 3rd, 2002, 01:31 PM
#3
Stuck in the 80s
Something like:
VB Code:
Option Explicit
Private Sub txtLines_Change()
Dim TOTAL As Double, LINES As Integer
LINES = Val(txtLines.Text)
TOTAL = 0.1 * LINES
txtTotal.Text = TOTAL
'simplified version:
'txtTotal.Text = 0.1 * Val(txtLines.Text)
End Sub
-
Nov 3rd, 2002, 01:32 PM
#4
Thread Starter
Addicted Member
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
|