I am having a few problems creating a simple quiz. In all my questions (3 of them), C is the correct answer. When the user answers A or B, I have a lblMsg box that should say Incorrect. When the user answers C, it should say Well Done - Click Go. The way it is right now is that it doesn't say anything after guessing A or B and when the user guesses C, it says Well Done - Click Go. Then after clicking go again, it says Incorrect. Then again after clicking go, it finally goes to the next question on the form2. Here is the code that I currently have:
Private Sub Command2_Click()
If Trim(UCase(Text1.Text)) = "C" Then
lblMsg.Caption = "Well Done"
QuestNum = QuestNum + 1
If QuestNum > UBound(Quest, 2) Then
lblMsg.Caption = "Done"
Form1.Hide
Form2.Show
End If
QuestNum = QuestNum + 1
If QuestNum > UBound(Quest, 2) Then
lblMsg.Caption = "Incorrect"
End If
End If
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
ReDim Quest(4, 4)
QuestNum = 1
Quest(0, 1) = "Which President is on the One Dollar Bill?"
Quest(1, 1) = "George W. Bush"
Quest(2, 1) = "Bill Clinton"
Quest(3, 1) = "George Washington"
Quest(4, 1) = 3
Quest(0, 2) = "Which of the following basketball players plays for the Indiana Pacers?"
Quest(1, 2) = "Michael Jordan"
Quest(2, 2) = "John Stockton"
Quest(3, 2) = "Reggie Miller"
Quest(4, 2) = 3
Quest(0, 3) = "What 24 hour news network does Larry King work for?"
Quest(1, 3) = "MSNBC"
Quest(2, 3) = "Fox News"
Quest(3, 3) = "CNN"
Quest(4, 3) = 3
' Show the first Q and Ans
lblQ.Caption = Quest(0, QuestNum)
lblA1.Caption = Quest(1, QuestNum)
lblA2.Caption = Quest(2, QuestNum)
lblA3.Caption = Quest(3, QuestNum)
End Sub
Private Sub Command2_Click()
If Trim(UCase(Text1.Text)) = "C" Then
lblMsg.Caption = "Well Done"
QuestNum = QuestNum + 1
If QuestNum > UBound(Quest, 2) Then
lblMsg.Caption = "Done"
Form1.Hide
Form2.Show
End If
QuestNum = QuestNum + 1
If QuestNum > UBound(Quest, 2) Then
lblMsg.Caption = "Incorrect"
End If
End If
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
ReDim Quest(4, 4)
QuestNum = 1
Quest(0, 1) = "Which President is on the One Dollar Bill?"
Quest(1, 1) = "George W. Bush"
Quest(2, 1) = "Bill Clinton"
Quest(3, 1) = "George Washington"
Quest(4, 1) = 3
Quest(0, 2) = "Which of the following basketball players plays for the Indiana Pacers?"
Quest(1, 2) = "Michael Jordan"
Quest(2, 2) = "John Stockton"
Quest(3, 2) = "Reggie Miller"
Quest(4, 2) = 3
Quest(0, 3) = "What 24 hour news network does Larry King work for?"
Quest(1, 3) = "MSNBC"
Quest(2, 3) = "Fox News"
Quest(3, 3) = "CNN"
Quest(4, 3) = 3
' Show the first Q and Ans
lblQ.Caption = Quest(0, QuestNum)
lblA1.Caption = Quest(1, QuestNum)
lblA2.Caption = Quest(2, QuestNum)
lblA3.Caption = Quest(3, QuestNum)
End Sub