is this a possible code to prevent typing a letter ?
code : text1_change
if val(text1.text),(len(text1.text)-1))=0 _
and mid(text1.text),(len(text1.text)-1)) <> 0 then
command1.enable = false
thanks for reading :)
lllld_bllll
Printable View
is this a possible code to prevent typing a letter ?
code : text1_change
if val(text1.text),(len(text1.text)-1))=0 _
and mid(text1.text),(len(text1.text)-1)) <> 0 then
command1.enable = false
thanks for reading :)
lllld_bllll
One trick is to use the KeyPress event;
Sub TextBox1_KeyPress(KeyAscii As Integer)
If KeyAscii = ASC("B") Then KeyAscii = 0
End Sub
Now the user cannot type a capital B into the box. This doesn't prevent them copying and pasting one in though.