Results 1 to 4 of 4

Thread: coding prob [resolved]

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2004
    Posts
    100

    coding prob [resolved]

    the code i enclose here have no errors but the output not appear..why?whts wrong with the code??

    VB Code:
    1. Private Sub btnKira_Click()
    2.  
    3. Dim X
    4. Dim Y
    5. Dim z
    6.  
    7. 'ratio value
    8. X = Val(txtHasil.Text) + Val(txtPulih.Text)
    9. Y = X / Val(txtPeriksa.Text)
    10. z = Format(Y, "0")
    11.  
    12. If txtKuantiti2.Text >= 2 And txtKuantiti2.Text <= 50 Then
    13.     Select Case z
    14.             Case z = 0
    15.                     txtRatio.Text = "0"
    16.                     txtAQL.Text = "2.5"
    17.                     txtSpriksa.Text = "5"
    18.                     txtLulus.Text = "0"
    19.                     txtGagal.Text = "1"
    20.             Case z = 1
    21.                     txtRatio.Text = "1"
    22.                     txtAQL.Text = "2.5"
    23.                     txtSpriksa.Text = "5"
    24.                     txtLulus.Text = "0"
    25.                     txtGagal.Text = "1"
    26.     End Select
    27. End If
    28. End Sub
    Last edited by azrina; Jan 24th, 2004 at 02:06 PM.

  2. #2
    Frenzied Member blindlizard's Avatar
    Join Date
    Feb 2001
    Location
    Austin, TX - United States of America
    Posts
    1,141
    Change this: Get rid of the x = in your case statements
    VB Code:
    1. Select Case z
    2.             Case 0
    3.                     txtRatio.Text = "0"
    4.                     txtAQL.Text = "2.5"
    5.                     txtSpriksa.Text = "5"
    6.                     txtLulus.Text = "0"
    7.                     txtGagal.Text = "1"
    8.             Case 1
    9.                     txtRatio.Text = "1"
    10.                     txtAQL.Text = "2.5"
    11.                     txtSpriksa.Text = "5"
    12.                     txtLulus.Text = "0"
    13.                     txtGagal.Text = "1"
    14.     End Select
    I drink to make other people more interesting!
    [vbcode]On Error GoTo Bar[/vbcode]
    http://www.monsterlizard.com

  3. #3
    Frenzied Member
    Join Date
    May 2003
    Location
    So Cal
    Posts
    1,564
    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.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2004
    Posts
    100
    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
  •  



Click Here to Expand Forum to Full Width