Jan 25, 2003 #1 E EZCheeZe Newcomer Joined Dec 12, 2002 Messages 7 Is there a way to make a text box only have numbers in it? Or if thats not possible, is there a way of determining if it is all numbers or not?
Is there a way to make a text box only have numbers in it? Or if thats not possible, is there a way of determining if it is all numbers or not?
Jan 25, 2003 #2 R Robby Ultimate Contributor Joined Nov 17, 2002 Messages 3,460 Location Montreal, Ca. you can use this in the KeyPress event... Visual Basic: If Not e.KeyChar.IsDigit(e.KeyChar) Then and this in the Validating event (in case they paste some text) Visual Basic: If Not IsNumeric(textbox1.Text) Then
you can use this in the KeyPress event... Visual Basic: If Not e.KeyChar.IsDigit(e.KeyChar) Then and this in the Validating event (in case they paste some text) Visual Basic: If Not IsNumeric(textbox1.Text) Then