Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking a string is a number between a range

Status
Not open for further replies.

Pyramus

Programmer
Dec 19, 2001
237
0
0
GB
I just want to check a value entered into a text box is a number (no letters in it) and is between 0 and 200. Any clues?
 
Try:

If IsNumeric(Mytextbox.text) and val(Mytextbox.text) >= 0 and val(Mytextbox.text) <= 0 then

Ralph
 
try something like the following:

Function CheckValue as boolean
dim retval as boolean

retval = false
if IsNumeric(txtBox.text) then
iF cint(txtbox.text) > 0 and cint(txtBox.text) < 200 then
retval = true
end if
end if

CheckValue = RetVal
end function

Hope this helps,

Chris Dukes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top