G
Guest
Private Sub txtCallerName_KeyPress(KeyAscii As Integer)
On Error GoTo Err_txtCallerName_KeyPress
Select Case KeyAscii
'65-90 are caps 97-122 are lower case; tab (9) and backspace (8) okay
Case 65 To 90, 97 To 122, 8, 9
Case Else
'Setting KeyAscii to zero cancels the key input
KeyAscii = 0
MsgBox "Please enter alphabetical characters only!"
End Select
Exit_txtCallerName_KeyPress
Exit Sub
Err_txtCallerName_KeyPress
MsgBox Err.Description
Resume Exit_txtCallerName_KeyPress
End Sub
Can someone tell me why this doesn't work?
On Error GoTo Err_txtCallerName_KeyPress
Select Case KeyAscii
'65-90 are caps 97-122 are lower case; tab (9) and backspace (8) okay
Case 65 To 90, 97 To 122, 8, 9
Case Else
'Setting KeyAscii to zero cancels the key input
KeyAscii = 0
MsgBox "Please enter alphabetical characters only!"
End Select
Exit_txtCallerName_KeyPress
Exit Sub
Err_txtCallerName_KeyPress
MsgBox Err.Description
Resume Exit_txtCallerName_KeyPress
End Sub
Can someone tell me why this doesn't work?