Limit entries in text box
Posted on 2000-03-19
A pretty dumb question really, but I am trying to limit text box entries to numbers only ?
I also need to allow the decimal point and backspace key to be used in the same text box ?
I can limit the entry to just numbers by using this line of code in the KeyPress event to display an error message if the user enters anything but the numbers 0 to 9.
If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
Error message etc.