Originally Posted by
pbaldy
From help, the Val() function "stops reading the string at the first character it can't recognize as part of a number" Since your existing function would return a value that starts with a number, the Val() function is a shortcut that will trim off the non-numeric portion and as you saw, returns a numeric value. The other function is longer but should return the same numbers. As you also saw, because the field it started with was text, it returned a text value. That could be overcome by adding a conversion function like CInt(). As is often the case, more than one way to skin a cat.