D
djbiehl via AccessMonster.com
I have the following external VBA function that I use in queries to get a
field name from a path. The function is as follows:
Public Function fieldName(fullPath As String)
fieldName = Right(fullPath, Len(fullPath) - InStrRev(fullPath, "\"))
End Function
The fullPath argument basically looks like this:
tablename\fieldname\different_table\different_field\another_table\
another_field
....and can have a varying number of tables and fields from:
table\field
to:
table\field\table\field\table\field\table\table\field\table\field
etc etc etc.
So basically the function that I have returns the rightmost field, aka:
whatever lies after the last "\"
I need to produce the same result without using my own function; Only using
Access' built in functions. However, there isn't an InStrRev function built
into access, only VBA. Does anyone know of a way to produce this same result
only using Access' built in functions?
field name from a path. The function is as follows:
Public Function fieldName(fullPath As String)
fieldName = Right(fullPath, Len(fullPath) - InStrRev(fullPath, "\"))
End Function
The fullPath argument basically looks like this:
tablename\fieldname\different_table\different_field\another_table\
another_field
....and can have a varying number of tables and fields from:
table\field
to:
table\field\table\field\table\field\table\table\field\table\field
etc etc etc.
So basically the function that I have returns the rightmost field, aka:
whatever lies after the last "\"
I need to produce the same result without using my own function; Only using
Access' built in functions. However, there isn't an InStrRev function built
into access, only VBA. Does anyone know of a way to produce this same result
only using Access' built in functions?