Selasa, 21 Desember 2010

validation input number textbox

Private Sub txtNomor_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") & Chr(13) _
And KeyAscii <= Asc("9") & Chr(13) _
Or KeyAscii = vbKeyBack _
Or KeyAscii = vbKeyDelete _
Or KeyAscii = vbKeySpace) Then
MsgBox "Must Number", vbOKOnly + vbInformation, "NUMBER"
KeyAscii = 0
End If
End Sub

Tidak ada komentar:

Posting Komentar