Nov 14, 2000 #1 Joeb1 Technical User Nov 13, 2000 4 US I want to make sure that users only enter numbers in a input box. What is an easy way to do this? Or even if I have to look for a range of 1 to 50. I tried an IF statement but I can't figure out how to set a range of numbers with the statement. Thanks
I want to make sure that users only enter numbers in a input box. What is an easy way to do this? Or even if I have to look for a range of 1 to 50. I tried an IF statement but I can't figure out how to set a range of numbers with the statement. Thanks
Nov 14, 2000 #2 dpaulson Programmer May 7, 2000 347 CA This seems to work Dim x As String Do While IsNumeric(x) = False x = InputBox("Enter Something" Loop David Paulson Upvote 0 Downvote
This seems to work Dim x As String Do While IsNumeric(x) = False x = InputBox("Enter Something" Loop David Paulson
Nov 14, 2000 Thread starter #3 Joeb1 Technical User Nov 13, 2000 4 US Thanks, I think I can get that to work. Upvote 0 Downvote
Nov 16, 2000 #4 chiph Programmer Jun 9, 1999 9,878 US Do you have to use an inputbox? You can use a textbox, and validate the input in the keypress event: [tt] If KeyAscii < Asc("0" Or KeyAscii > Asc("9" Then KeyAscii = 0 Exit Sub End If [/tt] Chip H. Upvote 0 Downvote
Do you have to use an inputbox? You can use a textbox, and validate the input in the keypress event: [tt] If KeyAscii < Asc("0" Or KeyAscii > Asc("9" Then KeyAscii = 0 Exit Sub End If [/tt] Chip H.