i have a code that if the user enters a letter or anything else beside a number then a msgbox popsout
somehow there is a text txt(11) that dosnt show the msgbox
this is my code
somehow there is a text txt(11) that dosnt show the msgbox
this is my code
Code:
Private Sub Txt_KeyPress(Index As Integer, KeyAscii As Integer)
If Index Like "[3]" Or Index Like "[4]" Or Index Like "[0]" Or Index Like "[8]" Or Index Like "[11]" Then
If Not (Chr$(KeyAscii) Like "[0-9-/]") And KeyAscii <> 8 Then
MsgBox "only numbers please", vbExclamation
KeyAscii = 0
End If
End If
End Sub