determining if an entry is a number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi guys

I am creating an exchange program with quickbooks and tables it imports are text fields, even ones that represent numbers.

so, I must create a validation rule that ensures only numbers are entered in those fields. There is a function in Javascript - NaN that can tell validate if user entered text and not a number. Does anybody have function like this?

Thanks,
David
 
VBA has a function called IsNumeric, which will return True or False
depending upon whether the argument given to it is numeric or not.

?IsNumeric("1234.56")
True

?IsNumeric("ABS123")
False


--

Ken Snell
<MS ACCESS MVP>

dp said:
Hi guys

I am creating an exchange program with quickbooks and tables it imports
are text fields, even ones that represent numbers.
so, I must create a validation rule that ensures only numbers are entered
in those fields. There is a function in Javascript - NaN that can tell
validate if user entered text and not a number. Does anybody have function
like this?
 
But be aware that D and E are treated as numbers if they're in the midst of
the digits:

?IsNumeric("12E34")
True
?IsNumeric("12D34")
True
 
Excellent point.

The alternative if such things are not to be allowed, dp, would be to write
a function that literally looks at each character and determines if that
character is a number or not.
 
Back
Top