Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.visual.basic    |    MS Visual Basic discussions, NOT dot-net    |    10,840 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 9,145 of 10,840    |
|    James L Hill to hennie    |
|    Re: TextBox Error    |
|    14 Jan 05 19:04:16    |
      From: james.hill83@verizon.net              Try this for allowing only numeric input into a text box:              Private Sub Text1_KeyPress(KeyAscii As Integer)       Const iNumber = "1234567890"       If InStr(iNumber, Chr(KeyAscii)) <> 0 Then       Exit Sub       Else       KeyAscii = 0       End If       End Sub              The Keypress method of the textbox is called when you type in anything.       Setting the value of KeyAscii to 0 kills the enter.       "hennie" |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca