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

If formula to find specific values in a string field?

Status
Not open for further replies.

pokerace

Technical User
May 24, 2005
118
US
C10

I am trying to write an if statement that can check a string field for a certain combination of charatcets, and then return an assigned string value if it is true, and another assigned value if not. Something like below but I can't get the proper syntax.

If InStr({StringField}, "ABC") then "Value 1"
else "Value 2"

Thanks.
 
Oooooooh, soooo close, try:

If InStr({StringField}, "ABC") > 0 then
"Value 1"
else
"Value 2"

-k
 
You almost had it:

If InStr({StringField}, "ABC") > 0 then "Value 1"
else "Value 2"

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top