BobtheRookie
Programmer
First i have this code written
StrAge = InputBox("How old are you?", "Age ask"
If (StrAge = "" Then
End
End If
IntAge = Val(StrAge)
Do While ((IntAge < 10) Or (IntAge > 99))
IntPress = MsgBox("your age must be between 10 and 99", vbExclamation, "Error!"
StrAge = InputBox("How old are you?", "Age ask"
If (StrAge = "" Then
End
End If
IntAge = Val(StrAge)
Loop
when i run this program i put in a number greater than 99. this tells me that i have to have a number between 10 and 99. After the input screen comes up again i put in a valid number and press enter. After i press enter the input box comes up again asking for my age but goes away after the second time i put it in.
What is wrong with my code and why does it repeat itself?
StrAge = InputBox("How old are you?", "Age ask"
If (StrAge = "" Then
End
End If
IntAge = Val(StrAge)
Do While ((IntAge < 10) Or (IntAge > 99))
IntPress = MsgBox("your age must be between 10 and 99", vbExclamation, "Error!"
StrAge = InputBox("How old are you?", "Age ask"
If (StrAge = "" Then
End
End If
IntAge = Val(StrAge)
Loop
when i run this program i put in a number greater than 99. this tells me that i have to have a number between 10 and 99. After the input screen comes up again i put in a valid number and press enter. After i press enter the input box comes up again asking for my age but goes away after the second time i put it in.
What is wrong with my code and why does it repeat itself?