Check this out
Code:Private Sub Command1_Click() If Question = 2 Then Question End If End Sub Public Function Question() As Integer strRightAnswer = "2" strAnswer = InputBox("1+1 = ?", "") If strAnswer = strRightAnswer Then MsgBox "Your Answer is Correct!", vbInformation ElseIf Trim(strAnswer) = "" Then MsgBox "You don't have an answer!", vbInformation Else MsgBox "Your Answer is Wrong!", vbInformation End If If Trim(strAnswer) = "" Then z = MsgBox("Are You Sure you want to skip this question?", vbInformation + vbOKCancel, "") Question = z End If End Function




Reply With Quote