I am using findfirst to locate records within my recordset. I would like the
record to be found only if the whole word exactly matches any word within the
sentence being searched. i.e.
String “Johnson Foodstore” returns false when searching for “John” but
String “John Smith Foodstore” returns true.
I have tried using wildcards but get to many unmatched returns.
Any help appreciated.
Joe
Hi,
you can try to search for %John %
with space at the end

Signature
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com
>I am using findfirst to locate records within my recordset. I would like
>the
[quoted text clipped - 8 lines]
> Any help appreciated.
> Joe
Visio Candar Control - 29 Jul 2005 11:39 GMT
Hello Alex
I have tried:
(both strsearch 1 & 2 declared as strings. The string being searched =
“Johns Foodstore” the search string = “Johns”
strsearch1 = "* " & astrTemp(intRow)
strsearch2 = "* " & astrTemp(intRow) & " *"
with:
rstSearch.FindFirst "[ProjectName] = '" & strsearch1& & "' or [ProjectName]
= '" & strsearch2 & "'"
Although I know the string exists the search fails.
Do you have any suggestions?
Regards
Joe
> Hi,
> you can try to search for %John %
[quoted text clipped - 12 lines]
> > Any help appreciated.
> > Joe
Alex Dybenko - 29 Jul 2005 12:48 GMT
hi,
should be:
rstSearch.FindFirst "[ProjectName] Like '" & strsearch1& & "' or
[ProjectName] Like '" & strsearch2 & "'"

Signature
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com
> Hello Alex
>
[quoted text clipped - 36 lines]
>> > Any help appreciated.
>> > Joe
Visio Candar Control - 29 Jul 2005 13:30 GMT
Hi Alex
There appears to be a quote missing in your search string VBA complains off
an “expected end of statement when the line is pasted and highlights the
second [ProjectName]
Regards
Joe
> hi,
> should be:
[quoted text clipped - 42 lines]
> >> > Any help appreciated.
> >> > Joe
Alex Dybenko - 29 Jul 2005 15:04 GMT
yes, you right!
> Hi Alex
> There appears to be a quote missing in your search string VBA complains
[quoted text clipped - 53 lines]
>> >> > Any help appreciated.
>> >> > Joe
Visio Candar Control - 29 Jul 2005 15:32 GMT
Hi Alex
I maybe right but I cannot workout where the quote should go. Could you
re-post the correct search string.
Regards
Joe
> yes, you right!
>
[quoted text clipped - 55 lines]
> >> >> > Any help appreciated.
> >> >> > Joe
Alex Dybenko - 30 Jul 2005 06:22 GMT
ok, there were 2 extra ampersands
rstSearch.FindFirst "[ProjectName] Like '" & strsearch1 & "' or
[ProjectName] Like '" & strsearch2 & "'"

Signature
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com
> Hi Alex
>
[quoted text clipped - 68 lines]
>> >> >> > Any help appreciated.
>> >> >> > Joe
JoeBo - 30 Jul 2005 07:46 GMT
Hello Alex
благодарю вас за помощь
JoeBo
> ok, there were 2 extra ampersands
> rstSearch.FindFirst "[ProjectName] Like '" & strsearch1 & "' or
[quoted text clipped - 72 lines]
> >> >> >> > Any help appreciated.
> >> >> >> > Joe