I'm trying to determine if the data in a string field is found in a list of possible strings. It needs to be an exact match. I can use a bunch of 'If' statements obviously, but is there a better way to search for a match, and then keep a record of matches, or non-matches? I don't want to generate any errors if no matches are found, just keep a counter.
Thanks.
vassup
0
Newbie Poster
Recommended Answers
Jump to PostHi
try the Following codedim count() as integer
dim SearchStr,TempStr,SourceString as string
rs.movefirst
For i=0 to rs.recordcount-1
redim count(i+1) preserve
count(i)=0
TempStr=sourceString
SearchStr=rs.fields("SearchString")
while Tempstr<>""
if instr(1,Tempstr,searchstr,vbTextCompare)>0 then
RefIndex=(1,Tempstr,searchstr,vbTextCompare)
tempStr=mid(tempstr,refindex+len(searchStr)count(i)=count(i)+1
else
tempstr=""
end if
wend
rs.movenext
nextfor i=0 to rs.recordcount-1
msgbox Count(i)
next…
All 3 Replies
vassup
0
Newbie Poster
venkatramasamy
1
Junior Poster in Training
venkatramasamy
1
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.