Unanswered: Need Correct Technique to Validate if Numeric
I would like to know the correct technique to validate whether text typed into a combo box is a whole number. I was unable to conquer the MASK property of the combo box because, with the mask 99999, the value passed to VBA for 1000 was 1000_
What does work is assigning the combo text to a numeric varible, for example, in the combo box UPDATE event:
ON ERROR GOTO NOT_A_NUMBER:
MyNumericVar = cboTargets.Text
ON ERROR GOTO 0
Msgbox "Enter only a number in the box"
I would like to know the correct method of data validation of a value typed into a text box to ensure that the value is numeric.
The combo is unbound. When I tried to use the MASK wizard, there was no option to not use a place holder, so the underscore was chosen. I removed this in the combo box properties window changing it from 99999;;_ to 99999, but the values passed shorter than 5 characters still had the underscore.