AnsweredAssumed Answered

Else If

Question asked by hbee on Sep 12, 2016
Latest reply on Sep 13, 2016 by beverly

Hi all

 

Apologies if this is in the wrong location, first time posting here!

 

Totally new to Filemaker so just trying to figure out a simple Else If function.  I have a page with a bunch of buttons, each with a different hazard from a risk assessment form.  Below this are 5 fields.  When a button is pressed, the hazard description is loaded into the fields.  If the first field is empty, the text goes there.  If it's full, the text goes in the second field.  If the second field is full, it goes in the third field.  And so on and so on.

 

I pieced together the following:

 

IF [field1=""]

INSERT TEXT [field1;"Access egress blocked restricted work place"]

 

ELSE IF [field1="0"]

INSERT TEXT [field2;"Access egress blocked restricted work place"]

 

ELSE IF [field1="0" and field2="0"]

INSERT TEXT [field3;"Access egress blocked restricted work place"]

 

END IF

 

Now I know this is probably a laughable attempt but the first part works at least.  If there's nothing in field1, the text inserts in there.  If I place a 0 in field one, the text inserts into field 2.  However, if I then add a 0 to field 2, the text still inserts into field 2 after the 0 so obviously the second ELSE IF function is wrong. 

 

So, my questions are:

 

What can I use in place of the and in order to make the second ELSE IF function consider the state of 2 fields instead of one?

 

And what can I use in place of the 0 to make the function see any data in the field, numerical or textual, and move onto the next field?

 

Any help would be greatly appreciated!

 

Thanks!

Outcomes