Sunday, September 6, 2009

Numbering input atau string input

Syntak utuk inputin di textbox dengan karakter angka :
---------------------------------------------------------
Private Sub Text1_KeyPress(KeyAscii As Integer)
If Not (KeyAscii <= Asc("9") And KeyAscii >= Asc("0") Or KeyAscii = vbKeyBack) Then
KeyAscii = 0
End If
End Sub
======&&&&=======
Syntak utuk inputin di textbox dengan karakter huruf:
---------------------------------------------------------
Private Sub Text2_KeyPress(KeyAscii As Integer)
If Not (KeyAscii <= 122 And KeyAscii >= 65 Or KeyAscii = vbKeyBack) Then
KeyAscii = 0
End If
End Sub

0 comments:

Post a Comment