Hi,

Could someone please tell me what I'm doing wrong here? The only keys I want the user to be able to press are number 1 to 9 on the keyboard, the subtract key, and the back space key. For some reason I can't understand the subtract key isn't recognised.

Private Sub Text5_KeyPress(KeyAscii As Integer)
If Not IsNumeric(Chr(KeyAscii)) And KeyAscii <> vbKeyReturn And KeyAscii <> vbKeySubtract And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub


Any help would be much appreciated!