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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

(if, like then) statement

Status
Not open for further replies.

dolfan1873

Technical User
Aug 10, 2004
21
0
0
US
i am trying to write an if statement that will find different occurances and return a result,
if Item = like "123A*" then
Cat = S
end if.

this works fine but to save alot of typeing or space i want to use the like for more than one instance
if item = like "123A*" or "123AB*" or "123B*" then
cat = S.

this does not work, can i do this or is the format just wrong, and if so can someone help on the format for this.

thanks
 
Replace this:
if item = like "123A*" or "123AB*" or "123B*" then
By this:
If item Like "123A*" Or item Like "123AB*" Or item Like "123B*" Then
Anyway testing for "123AB*" is unnecessary as already catched by "123A*".

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top