This works!
I'm not saying it's well structured though!
Code:Option Explicit Dim pvb(7) As proverb Private Type proverb phrase As String value As Integer End Type Private Sub cmdClick_Click() 'to display proverbs and collect score DisplayProverbs End Sub Private Sub cmdExit_Click() End End Sub Public Sub DisplayProverbs() 'display proverbs to obtain answers Dim i As Integer Dim score As Integer For i = 0 To 6 If MsgBox(pvb(i).phrase & vbCrLf & vbCrLf & " (Reply with 'YES' for True or 'NO' for False.)", vbYesNo) = pvb(i).value Then score = score + 1 End If Next i Picture1.Cls Picture1.Print Response(score) & vbCrLf & vbCrLf & " You answered " & score & " correctly." End Sub Public Function Response(score As Integer) As String Select Case score Case Is >= 7 Response = "Perfect" Case 5 To 6 Response = "Excellent" Case Is < 5 Response = "You might consider taking Psychology 101. " End Select End Function Private Sub Form_Load() pvb(0).phrase = "The squeaky wheel gets the grease." pvb(0).value = vbYes pvb(1).phrase = "Cry and you cry alone." pvb(1).value = vbYes pvb(2).phrase = "Opposites attract." pvb(2).value = vbNo pvb(3).phrase = "Spare the rod and spoil the child." pvb(3).value = vbNo pvb(4).phrase = "Actions speak louder than words." pvb(4).value = vbYes pvb(5).phrase = "Familiarity breeds contempt." pvb(5).value = vbNo pvb(6).phrase = "Marry in haste, repent at leisure." pvb(6).value = vbYes End Sub






Reply With Quote