|
-
Jan 24th, 2004, 01:49 PM
#1
Thread Starter
Lively Member
coding prob [resolved]
the code i enclose here have no errors but the output not appear..why?whts wrong with the code??
VB Code:
Private Sub btnKira_Click()
Dim X
Dim Y
Dim z
'ratio value
X = Val(txtHasil.Text) + Val(txtPulih.Text)
Y = X / Val(txtPeriksa.Text)
z = Format(Y, "0")
If txtKuantiti2.Text >= 2 And txtKuantiti2.Text <= 50 Then
Select Case z
Case z = 0
txtRatio.Text = "0"
txtAQL.Text = "2.5"
txtSpriksa.Text = "5"
txtLulus.Text = "0"
txtGagal.Text = "1"
Case z = 1
txtRatio.Text = "1"
txtAQL.Text = "2.5"
txtSpriksa.Text = "5"
txtLulus.Text = "0"
txtGagal.Text = "1"
End Select
End If
End Sub
Last edited by azrina; Jan 24th, 2004 at 02:06 PM.
-
Jan 24th, 2004, 01:53 PM
#2
Frenzied Member
Change this: Get rid of the x = in your case statements
VB Code:
Select Case z
Case 0
txtRatio.Text = "0"
txtAQL.Text = "2.5"
txtSpriksa.Text = "5"
txtLulus.Text = "0"
txtGagal.Text = "1"
Case 1
txtRatio.Text = "1"
txtAQL.Text = "2.5"
txtSpriksa.Text = "5"
txtLulus.Text = "0"
txtGagal.Text = "1"
End Select
-
Jan 24th, 2004, 01:53 PM
#3
Frenzied Member
Hard to say without knowing what you are actually trying to do.
Do a Step Into the code at the Click command and watch what it does, this will show you what is happening and you can view all your variables.
-
Jan 24th, 2004, 02:05 PM
#4
Thread Starter
Lively Member
thank u all
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
|