PDA

View Full Version : CheckString function for numbers question


gcapp
10-27-2002, 05:05 PM
Is there a function that is similar to CheckString to see if the entry to my database table is a number??

I'm using a CheckString function that works for text datatypes and I wondered if there was one for number datatypes?

Or can this CheckString function be modified for numbers (i.e. CheckNumber??)

FUNCTION CheckString (s, endchar)
pos = InStr(s, "'")
While pos > 0
s = Mid(s, 1, pos) & "'" & Mid(s, pos + 1)
pos = InStr(pos + 2, s, "'")
Wend
CheckString="'" & s & "'" & endchar
END FUNCTION

whammy
10-27-2002, 11:22 PM
IsNumeric()

:)

http://www.haneng.com/FunctionSearch.asp?s=IsNumeric
http://www.devguru.com/Technologies/vbscript/quickref/isnumeric.html
http://www.asp-examples.com/objects/VBScript/default.asp?LookUp=IsNumeric
http://www.w3schools.com/vbscript/func_isnumeric.asp