Question

In filemaker, If field1 (date field) is filled, I want field2 value to be "a", if field1 is empty, i want field2 value to be b

I tried In the options for field2, validated by calculation, specify calculation, and this formula:

If (IsEmpty(field1),"valueb","valuea")    

But I get the following error: A number, text constant, field name or “(” is expected here.

Two Questions.

  1. will this way work?
  2. is my syntax wrong?

If anyone could point out what could be wrong, I would appreciate it tremendously.

Was it helpful?

Solution

The issue that you're running into is that you're trying to write a value into a field by using the field's data validation options rather than it's auto-enter options.

The validation calculation will show your user an error message but does nothing to write to the field other than reverting the field to it's pre-user-edited value.

The auto-enter options will allow you to write data to the field. If the two fields are in the same table, the auto-enter calculation for field2 will fire when you modify field1.

That said, let's take a look at what you're trying to accomplish.

What you want: When field1 is not empty, field2 should hold the value "a". When field1 is empty, field2 should hold the value "b".

The auto-enter calculation for field2 should be:

if ( not IsEmpty( field1 ) ; "b" ; "a" )

If the two fields are in different tables it changes things a bit, but it seems like this is what you're going for.

I hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top