candekissez
May 11th, 2001, 11:21 PM
I wrote this program for a project, thought it was working but it ends up doin what its suppose to once and then when u try to click an operation again it skips my Do..While loop.. why, what do i do to fix it??!?! Help!!! Fast!!!!
Here's ONE section of the code...
'Set Do..Whille loop to enter values to add together and enter "999" to stop the inputbox.
Do While result <> 999
result = InputBox("Enter the values <999 to stop>")
If result <> 999 Then
x = x + result
End If
Loop
'Ask the user to enter the answer they think it is
response = InputBox("What do you think the answer is?", "Answer")
'Display a sad face if their answer is wrong or a happy face if the answer is correct
If response = x Then
frmHappy.Visible = True
response = MsgBox("Congratulations! You got it right!", vbExclamation, "Happy")
Else
frmSad.Visible = True
response = MsgBox("No, I'm sorry.. You should try again, or would you like to see the right answer?", vbYesNo, "Sad")
If response = vbYes Then
MsgBox ("The correct answer is " & x)
ElseIf response = vbNo Then
frmSad.Show
End If
End If
Smile - somewhere its helping someone.
Here's ONE section of the code...
'Set Do..Whille loop to enter values to add together and enter "999" to stop the inputbox.
Do While result <> 999
result = InputBox("Enter the values <999 to stop>")
If result <> 999 Then
x = x + result
End If
Loop
'Ask the user to enter the answer they think it is
response = InputBox("What do you think the answer is?", "Answer")
'Display a sad face if their answer is wrong or a happy face if the answer is correct
If response = x Then
frmHappy.Visible = True
response = MsgBox("Congratulations! You got it right!", vbExclamation, "Happy")
Else
frmSad.Visible = True
response = MsgBox("No, I'm sorry.. You should try again, or would you like to see the right answer?", vbYesNo, "Sad")
If response = vbYes Then
MsgBox ("The correct answer is " & x)
ElseIf response = vbNo Then
frmSad.Show
End If
End If
Smile - somewhere its helping someone.