The function:
Function FirstNum(StringToParse)
Dim NumVal As Integer
For i = 1 To Len(StringToParse)
If IsNumeric(Mid(StringToParse, i, 1)) Then
FirstNum = (Mid(StringToParse, i, 1))
Exit Function
End If
Next
End Function
To call it, where the field you're searching is named FieldToParse and the
field to hold the number is NumericalValue
Me.NumericalValue = FirstNum(Me.FieldToParse)
BTW, ***VAL*** is the name of an Access function and should not be used as a
variable name.
--
There's ALWAYS more than one way to skin a cat!
Answers/posts based on Access 2000/2003
Message posted via AccessMonster.com