|
-
Jun 4th, 2013, 04:23 PM
#1
Thread Starter
Hyperactive Member
Numbers Only and - Only
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
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
|