I want that in my whole program the user can only enter data as numbers (0-9), alphabetical (a-z) and . (dot/point).
How can I disable all the other keys?
I know the code how to permit the keys in the keypress event of any textbox
by using this code:
Expand|Select|Wrap|Line Numbers
- Dim comp As Boolean
- comp = Chr(KeyAscii) Like "[1-9.0]"
- If Chr(KeyAscii) = vbBack Then Exit Sub
- If comp = False Then
- KeyAscii = 0
- End If
How to do this?