i am trying to compare user input number to with strings. i want the users to only input numeric values in a text box. but if they input a string i want an error message to go inform then to input numbers. this is the code i have:
'asigning values to text boxes
variable1 = Var1.Text
Do While IsNumeric(variable1) = False And IsNumeric(variable2) = False
variable2 = Var2.Text
If IsNumeric(variable1) Or IsNumeric(variable2) = False Then
MsgBox("please enter a numeric value")
End If
Loop
it does not work(this is for a calculator)
'asigning values to text boxes
variable1 = Var1.Text
Do While IsNumeric(variable1) = False And IsNumeric(variable2) = False
variable2 = Var2.Text
If IsNumeric(variable1) Or IsNumeric(variable2) = False Then
MsgBox("please enter a numeric value")
End If
Loop
it does not work(this is for a calculator)