instr

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Thanks for taking the time to read my question.

I have a field in a table that holds many values as a string

for example

lola br bgn ddt mmn lol

I want to use instr to find "lol". The problem is that it finds "lola" How
can I make this work so that it only finds "lol"? Each value in the string
is separated by a space.

I could step through each value in the string with a loop, but wondering if
there is a better way.

Thanks,

Brad
 
Brad said:
I have a field in a table that holds many values as a string

for example

lola br bgn ddt mmn lol

I want to use instr to find "lol". The problem is that it finds "lola" How
can I make this work so that it only finds "lol"? Each value in the string
is separated by a space.


Concatenate a space to each ens of botl the field and the
thing you're trying to find:

InStr(" " & thefield & " ", " " & somevalue & " ")
 
That is so briliant, I'm laughing out loud!!! I was trying to use the Split
function, but found out that it was introduced in 2000... unfortunately I'm
working in 97.

Thanks Marshall. Now maybe I'll be able to go home... it is Friday after all.

Have a great weekend,

Brad
 
Back
Top