wolf.stalker
01-27-2008, 09:05 PM
hi all:
first time to site, and hopefully not the last. i have been working on a project and could use some help.
here is the jist of it. my source data is read in through a text box called txtUnlGross. what i am trying to do is to prevent any key other than 0-9 being entered.
my first attempt at this resulted in that it would function, but not alow any number with the 9 in it. for example, you could key in something like 10000 but you would get an error msg from 89 or 90 or 19 etc.
Anyone have any idea why i am getting this error?
Private Sub txtUnlGross_Change()
Select Case txtUnlGross.Value
Case 0 To 9
'do nothing
Case ""
'do nothing
Case Else
MsgBox ("This must be a number less than 15,000.")
txtUnlGross = ""
txtUnlGross.SetFocus
Exit Sub
End Select
txtUnlNet.Enabled = True
End Sub
thanks!
first time to site, and hopefully not the last. i have been working on a project and could use some help.
here is the jist of it. my source data is read in through a text box called txtUnlGross. what i am trying to do is to prevent any key other than 0-9 being entered.
my first attempt at this resulted in that it would function, but not alow any number with the 9 in it. for example, you could key in something like 10000 but you would get an error msg from 89 or 90 or 19 etc.
Anyone have any idea why i am getting this error?
Private Sub txtUnlGross_Change()
Select Case txtUnlGross.Value
Case 0 To 9
'do nothing
Case ""
'do nothing
Case Else
MsgBox ("This must be a number less than 15,000.")
txtUnlGross = ""
txtUnlGross.SetFocus
Exit Sub
End Select
txtUnlNet.Enabled = True
End Sub
thanks!