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.