Upload
agrippah-mungazi
View
215
Download
0
Embed Size (px)
DESCRIPTION
Keypress validation
Citation preview
Private Sub txtPName_KeyPress(KeyAscii As Integer)If (KeyAscii > 64 And KeyAscii < 91) Or (KeyAscii > 96 And KeyAscii < 123) Thentext1 = text1ElseKeyAscii = oBeepMsgBox "Valid Characters are " + " a To z and A To Z only"End IfEnd Sub
Private Sub txtPSurname_KeyPress(KeyAscii As Integer) Select Case Chr(KeyAscii) Case 0 To 9 KeyAscii = 0 End Select
End Sub