Hallo
I´m new to this group. I hope I´m not going to lower the tone too
much.
The problem with the code below seems to be in the Private Sub
mnumchoice_Click()
Any help greatly appreciated. And Merry Christmas
of course.
Paul
Option Explicit
Dim QuePreps As Integer ' question
number to answer Prepositions
Dim QueVerbs As Integer ' question number to
answer Verbs
Dim Quemul As Integer ' question number to answer muiltiple
choice
questions
Dim Score As Integer ' score
Dim
Prepositions(19) As String ' declared array of Phrasal Verbs by
Prepositions 20 in all
Dim Verbs(19) As String ' declared array of
Phrasal Verbs by
Verbs 20 in all
Private Sub cmdendquiz1_Click()
' ends the quiz answer Verb/Preps
fratype.Visible = False ' sets the correct
values to
orginal state
mnuoption.Enabled = True ' hides the frame and
shows the
start label
mnuendquiz.Enabled = False
lblstart.Visible =
True
Score = 0
QuePreps = 0
End Sub
Private Sub
cmdquestion_Click()
' this selects the case QuePreps corresponding to
answer
Prepositions type in questions
' here i set it so, if the typed in
answer = the correct Prepositions
()array then
' increase score by 1, then
set the next question to the next team
up in the array
' and increase the
question number, i have repeated this for all
questions
Select Case
QuePreps
Case 1
If txtAnswer.Text = Prepositions(0) Then
Score =
Score + 1
End If
lblquestion.Caption = Verbs(1)
txtAnswer.Text =
""
QuePreps = QuePreps + 1
Case 2
If txtAnswer.Text =
Prepositions(1) Then
Score = Score + 1
End
If
lblquestion.Caption = Verbs(2)
txtAnswer.Text = ""
QuePreps =
QuePreps + 1
Case 3
If txtAnswer.Text = Prepositions(2) Then
Score
= Score + 1
End If
lblquestion.Caption = Verbs(3)
txtAnswer.Text =
""
QuePreps = QuePreps + 1
Case 4
If txtAnswer.Text =
Prepositions(3) Then
Score = Score + 1
End
If
lblquestion.Caption = Verbs(4)
txtAnswer.Text = ""
QuePreps =
QuePreps + 1
Case 5
If txtAnswer.Text = Prepositions(4) Then
Score
= Score + 1
End If
lblquestion.Caption = Verbs(5)
txtAnswer.Text =
""
QuePreps = QuePreps + 1
Case 6
If txtAnswer.Text =
Prepositions(5) Then
Score = Score + 1
End
If
lblquestion.Caption = Verbs(6)
txtAnswer.Text = ""
QuePreps =
QuePreps + 1
Case 7
If txtAnswer.Text = Prepositions(6) Then
Score
= Score + 1
End If
lblquestion.Caption = Verbs(7)
txtAnswer.Text =
""
QuePreps = QuePreps + 1
Case 8
If txtAnswer.Text =
Prepositions(7) Then
Score = Score + 1
End
If
lblquestion.Caption = Verbs(8)
txtAnswer.Text = ""
QuePreps =
QuePreps + 1
Case 9
If txtAnswer.Text = Prepositions(8) Then
Score
= Score + 1
End If
lblquestion.Caption = Verbs(9)
txtAnswer.Text =
""
QuePreps = QuePreps + 1
Case 10
If txtAnswer.Text =
Prepositions(9) Then
Score = Score + 1
End
If
lblquestion.Caption = Verbs(10)
txtAnswer.Text = ""
QuePreps =
QuePreps + 1
Case 11
If txtAnswer.Text = Prepositions(10)
Then
Score = Score + 1
End If
lblquestion.Caption =
Verbs(11)
txtAnswer.Text = ""
QuePreps = QuePreps + 1
Case 12
If
txtAnswer.Text = Prepositions(11) Then
Score = Score + 1
End
If
lblquestion.Caption = Verbs(12)
txtAnswer.Text = ""
QuePreps =
QuePreps + 1
Case 13
If txtAnswer.Text = Prepositions(12)
Then
Score = Score + 1
End If
lblquestion.Caption =
Verbs(13)
txtAnswer.Text = ""
QuePreps = QuePreps + 1
Case 14
If
txtAnswer.Text = Prepositions(13) Then
Score = Score + 1
End
If
lblquestion.Caption = Verbs(14)
txtAnswer.Text = ""
QuePreps =
QuePreps + 1
Case 15
If txtAnswer.Text = Prepositions(14)
Then
Score = Score + 1
End If
lblquestion.Caption =
Verbs(15)
txtAnswer.Text = ""
QuePreps = QuePreps + 1
Case 16
If
txtAnswer.Text = Prepositions(15) Then
Score = Score + 1
End
If
lblquestion.Caption = Verbs(16)
txtAnswer.Text = ""
QuePreps =
QuePreps + 1
Case 17
If txtAnswer.Text = Prepositions(16)
Then
Score = Score + 1
End If
lblquestion.Caption =
Verbs(17)
txtAnswer.Text = ""
QuePreps = QuePreps + 1
Case 18
If
txtAnswer.Text = Prepositions(17) Then
Score = Score + 1
End
If
lblquestion.Caption = Verbs(18)
txtAnswer.Text = ""
QuePreps =
QuePreps + 1
Case 19
If txtAnswer.Text = Prepositions(18)
Then
Score = Score + 1
End If
lblquestion.Caption =
Verbs(19)
txtAnswer.Text = ""
QuePreps = QuePreps + 1
' This case is
the same in adding the score but instead of moving
onto the
' next
question i have have displayed the score by msgbox and once
the user
clicks
' ok the quiz ends and all values are set to there orginal state
ready for another
' quiz to take place
Case 20
If txtAnswer.Text =
Prepositions(19) Then
Score = Score + 1
End If
txtAnswer.Text =
""
MsgBox "You scored " & Score & " Out of 20 correct, Press okay to
end quiz", vbOKOnly, "Score"
fratype.Visible = False
lblstart.Visible
= True
mnuendquiz.Enabled = False
mnuoption.Enabled = True
Score =
0
QuePreps = 0