If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
Extracting the numbers from the Text Field
To expand on Ken Snell's observation.
If you are checking one character at a time then IsNumeric will return false for any character that is not in the range 0 to 9. If you are checking an entire string of multiple characters at once then you can end up with unexpected results if all you want is just the number characters. IsNumeric can return true if there are commas or only one period in the string. Also it can return true if the string can be read as a scientific notation number (1.043E4) or (1.034D5). And it seems to ignore one currency symbol (at least the $ sign) one negative sign one plus sign parentheses around the number. Probably a few other things to. Basically if a human (computer savvy) would read the string as a just number then IsNumeric seems to return true. John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Ken Snell wrote: Also, IsNumeric will allow decimal points, etc. to remain as characters in the string as well, so it sometimes is not a good choice when wanting just numbers to remain. |
|
Thread Tools | |
Display Modes | |
|
|