Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Compare

Status
Not open for further replies.

Sarky78

Programmer
Oct 19, 2000
878
GB
Hi I want to do a multiple compare to see if a value contains one of many entries

at the moment i have got the following code:

noindex = instr(rs("vpath"),"admin")
if noindex = 0 then
endcount = endcount +1
end if

to save having to do about 20 if statements, is there any way that i can do a multiple compare like

noindex = instr(rs("vpath"),"admin" OR "includes" etc)

any ideas ??

 
Code:
strPath = lcase(rs("vpath")) ' if Case does not matter
I = 0
For I = lBound(aryLook) to Ubound(aryLook)
    noindex = instr(1,strPath,arylook(I),vbCompareBinary)
    if noindex = 0 then
        endcount = endcount +1
    end if
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top