GaryWilsonCPA
Technical User
This code is part of a button that calculate the amount of a value for units times unit cost.
I use the following to test if a value in a textbox is numeric. It works properly.
CODE TO WARN THAT TEXT IS NOT NUMERIC
If IsNumeric(Val(editQuantity.Text)) = True Then
MsgBox("Quanitity must be numeric?")
End If
If the value is not numeric, I want to skip the following code and place the tab location back to the editquantity text box.
Dim mynumber1 = Val(editQuantity.Text)
Dim mynumber2 = Val(UnitsUnbound.Text)
editAmount.Text = mynumber1 * mynumber2
Units.Text = UnitsUnbound.Text
Quantity.Text = editQuantity.Text
What is the best way to skip the code and jump back to the text box?
Thanks for any help.
I use the following to test if a value in a textbox is numeric. It works properly.
CODE TO WARN THAT TEXT IS NOT NUMERIC
If IsNumeric(Val(editQuantity.Text)) = True Then
MsgBox("Quanitity must be numeric?")
End If
If the value is not numeric, I want to skip the following code and place the tab location back to the editquantity text box.
Dim mynumber1 = Val(editQuantity.Text)
Dim mynumber2 = Val(UnitsUnbound.Text)
editAmount.Text = mynumber1 * mynumber2
Units.Text = UnitsUnbound.Text
Quantity.Text = editQuantity.Text
What is the best way to skip the code and jump back to the text box?
Thanks for any help.