NewJerseyDevils
New Member
- Joined
- Jan 14, 2004
- Messages
- 1
I would like to use If Then statements to validate input text for a simple VB program. I am using:
Private Sub txtDecDegs_KeyPress(KeyAscii As Integer)
If KeyAscii < 47 And KeyAscii > 57 Then
MsgBox "Please enter numbers"
End If
But keypresses outside of my specified range (i.e. 47 to 57 or 0 to 9) are not bringing up the message box.
Any ideas?
Private Sub txtDecDegs_KeyPress(KeyAscii As Integer)
If KeyAscii < 47 And KeyAscii > 57 Then
MsgBox "Please enter numbers"
End If
But keypresses outside of my specified range (i.e. 47 to 57 or 0 to 9) are not bringing up the message box.
Any ideas?