Example of Essay
Dim INCRRECT As Integer
Private Sub Command1_Click ()
If txtans1 = "KOBE BRYANT" Or txtans1 = "KOBE" Then
SCORE = SCORE + 1
Else
INCORRECT = INCORRECT + 1
End If
If txtans2 = "VANESSA HUDGENS" Then
SCORE = SCORE + 1
Else
INCORRECT = INCORRECT + 1
End If
If txtans3 = "TAYLOR SWIFT" Then
SCORE = SCORE + 1
Else
INCORRECT = INCORRECT + 1
End If
If txtans4 = "CLEVELAND" Or txtans4 = "CAVALIERS" Then
SCORE = SCORE + 1
Else
INCORRECT = INCORRECT + 1
End If
If txtans5 = "MAGIC" Or txtans5 = "MAGIC" Then
SCORE = SCORE + 1
Else
INCORRECT = INCORRECT + 1
End If
If txtans6 = "MANNY PACQUIAO" Or txtans6 = "PACQUIAO" Then
SCORE = SCORE + 1
Else
INCORRECT = INCORRECT + 1
End If
If txtans7 = "JAMES YAP" Then
SCORE = SCORE + 1
Else
INCORRECT = INCORRECT + 1
End If
If txtans8 = "SLUMDOG MILLIONAIRE" Then
SCORE = SCORE + 1
Else
INCORRECT = INCORRECT + 1
End If
If txtans9 = "WHITE HOUSE" Then
SCORE = SCORE + 1
Else
INCORRECT = INCORRECT + 1
End If
If txtans10 = "CORY" Or txtans10 = "CORAZON AQUINO" Then
SCORE = SCORE + 1
Else
INCORRECT = INCORRECT + 1
End If
Command1.Enabled = False
lblcorrect.text = SCRE
lblincorrect.text = INCORRECT
If SCORE>= 9 Then
lblremark.caption = "EXCELLENT"
Elself SCORE>= 7 Then
lblremark.caption = "VERY GOOD"
Elself SCORE>= 5 Then
lblremark.caption = "GOOD"
Elself SCORE>= 3 Then
lblremark.caption = "NEEDS IMPROVEMENT"
Else
lblremark.caption = "FAILED"
End If
End Sub
Private Sub txtans1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtans1.Text = UCase(txtans1)
txtans2.SetFocus
End If
End Sub
Private Sub txtans10_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtans10.Text = UCase(txtans10)
End If
End Sub
Private Sub txtans2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtans2.Text = UCase(txtans3)
txtans3.SetFocus
End If
End Sub
Private Sub txtans3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtans3.Text = UCase(txtans3)
txtans4.SetFocus
End If
End Sub
Private Sub txtans4_KeyPress(KeyAscii as Integer)
If KeyAscii = 13 Then
txtans4.text = UCase(txtans3)
txtans5.SetFocus
End If
End Sub
Private Sub txtans5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtans5.text = UCase(txtans5)
txtans6.SetFocus
End If
End Sub
Private Sub txtans6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtans6.text = UCase(txtans7)
txtans7.SetFocus
End If
End Sub
Private Sub txtans7_KeyPress(KeyAscii As Integer)
If KeyAscii = Then
txtans7.text = Right(txtans7,4)
txtans8.SetFocus
End If
End Sub
Private Sub txtans8_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtans8.Text = left(txtans9,3)
txtans9.SetFocus
End If
End Sub
Private Sub txtans9_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtans9.Text = UCase(txtans9)
txtans10.SetFocus
End If
End If
End Sub
Please join StudyMode to read the full document