Thread: VB6 Question...
View Single Post
  #1  
Old 23rd Feb 03, 06:58 PM
Sephiroth Sephiroth is offline
BetaONE Supporter
 
Join Date: Jul 2001
Posts: 1,979
Sephiroth is an unknown quantity at this point
Send a message via MSN to Sephiroth
nevermind, this fixed it

Quote:

Private Sub cmdCalculate_Click()
   
   If txtName.Text = "" Then
       MsgBox "Please enter a student name."
   End If
   
   If ValidGrade(txtT1.Text) = False Then
       MsgBox "Please enter a number between 0 and 100 into Test 1."
   End If
   
   If ValidGrade(txtT2.Text) = False Then
       MsgBox "Please enter a number between 0 and 100 into Test 2."
   End If
   
   If ValidGrade(txtT3.Text) = False Then
       MsgBox "Please enter a number between 0 and 100 into Test 3."
   End If
   
   Dim pstrCGrade As Integer
   pstrCGrade = (Val(txtT1.Text) + Val(txtT2.Text) + Val(txtT3.Text)) / 3
   
   Select Case pstrCGrade
       Case 100 To 90
           lblCGrade.Caption = "A"
       Case 79 To 89
           lblCGrade.Caption = "B"
       Case 69 To 78
           lblCGrade.Caption = "C"
       Case 59 To 68
           lblCGrade.Caption = "D"
       Case 0 To 58
           lblCGrade.Caption = "F"
   End Select

End Sub
Reply With Quote