Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21103

[RESOLVED] Txt index dosnt work on txt(11)

$
0
0
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
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


Viewing all articles
Browse latest Browse all 21103

Trending Articles