Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Little IF statment problem


Terry215

Recommended Posts

I found the answer to this at one time but can't for the life of me remember what it was.

 

I have a field CITY and I want to do something only if the city matches a spacific list.

 

IF CITY = "city1" or "city2" or "city3" or "city4"

go to layout

else

custom dialouge

endif

 

What did I do wrong?

 

Terry

Link to comment
Share on other sites

You need to use the following syntax:

 

If ( City = "City1" or City = "City2" or City = "City3"; True Result; False Result )

 

I am sure there are more efficient ways to do it...but my brain is processing a little slow today.

Link to comment
Share on other sites

You write

 

IF CITY = "city1" or "city2" or "city3" or "city4"

 

Human reads that as

 

IF CITY = "city1" or city = "city2" or city = "city3" or city = "city4"

 

seems self-evident and self-explanatory doesn't it? Not to FileMaker. An "or" clause divides one expression from another. All IF statements with or clauses will be read like this by FileMaker:

 

If [this is a true statement] or [that is a true statement] or [this other thing is a true statement]

 

Thus what you've asked for is:

 

IF [CITY = "city1" is a true statement] or ["city2" is a true statement] or ["city3" is a true statement] or ["city4" is a true statement]

 

that's not what you want. Redo it like this, being explcit:

 

IF CITY = "city1" or city = "city2" or city = "city3" or city = "city4"

Link to comment
Share on other sites

You write

 

IF CITY = "city1" or city = "city2" or city = "city3" or city = "city4"

 

Ahhhh.... thats the one, I knew it was something real simple.

 

Thanks

 

Terry

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

Terms of Use