Hi Leen,
Put this code in a module, and use it as a normal function, e.g.
cur_value = Extr_int("A1011.bmp")
In this example cur_value = 1011.
Function Extr_int(cur_string As String) As Integer
Dim x As Integer
Dim cur_char As String
Dim new_string As String
For x = 1 To Len(cur_string)
cur_char = Mid(cur_string, x, 1)
Select Case cur_char
Case "0" To "9": new_string = new_string & cur_char
End Select
Next
Extr_int = CInt(new_string)
End Function
I assume it is easy to modify this function for Long integers, or add
further functionality in the case that you only want to have the first
serie of digits.
Success, HBInc.
leen wrote:
I'm working in Access2000 and am having trouble finding a way to take
imported "OLEPath" field values in my database and filter out or
eliminate all the alpha text so we only get numeral values, allowing
for number formatting. only the first and the last 4 of every value is
text. Here's some examples taken from a table: "A1011.bmp" or
"A201.bmp". I need to get the values to read as "1011" and "201".
Is there a way to do this with SQL Select statement or VBA(if
impossible with SQL.)
plz...i really need a help..