|
-
Jul 16th, 2002, 03:21 AM
#4
Hyperactive Member
I'm very sorry, but I've done it wrong. The following code must be pasted in the KeyPress event:
Private Sub cboNRIC_KeyPress(KeyAscii As Integer)
On Error GoTo ErrorHandler
If (KeyAscii >= Asc("0") And KeyAscii <= Asc("9")) Or KeyAscii = Asc("-") Or KeyAscii = vbKeyBack Then '8 = backspace
'do nothing
Else
KeyAscii = 0
End If
Exit Sub
ErrorHandler:
MsgBox Err.Number & vbcrl & Err.Description
End Sub
That's all. I've tested it, and it works deliciously.
grtz
jmvv
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|