Hi All
I am try to only type numbers in a textbox and stop letters from going into textbox which works fine, But I also want ------- to appear in textbox I looked up on the internet and should be vbKeySubtract so I added to one of the case lines but don't work just beeps
Can someone please help me out with this thanks
http://msdn.microsoft.com/en-us/libr...(v=vs.60).aspx
Private Sub Text1_KeyPress(KeyAscii As Integer)
'Accepts only numeric input
Select Case KeyAscii
Case vbKey0 To vbKey9
Case vbKeyBack, vbKeyClear, vbKeyDelete, vbKeySubtract
Case vbKeyLeft, vbKeyRight, vbKeyUp, vbKeyDown, vbKeyTab
Case Else
KeyAscii = 0
Beep
End Select
End Sub
Kind Regards
Steve
I am try to only type numbers in a textbox and stop letters from going into textbox which works fine, But I also want ------- to appear in textbox I looked up on the internet and should be vbKeySubtract so I added to one of the case lines but don't work just beeps
Can someone please help me out with this thanks
http://msdn.microsoft.com/en-us/libr...(v=vs.60).aspx
Private Sub Text1_KeyPress(KeyAscii As Integer)
'Accepts only numeric input
Select Case KeyAscii
Case vbKey0 To vbKey9
Case vbKeyBack, vbKeyClear, vbKeyDelete, vbKeySubtract
Case vbKeyLeft, vbKeyRight, vbKeyUp, vbKeyDown, vbKeyTab
Case Else
KeyAscii = 0
Beep
End Select
End Sub
Kind Regards
Steve