1 Reply Latest reply on Apr 16, 2010 3:05 AM by Steve Wright

    Blocking/locking a field



      Blocking/locking a field


      Hallo everyone


      I have two fields (field A and B) which i would like to have locked if another field C contains any value (is non-empty). What I mean by locked is that the fields cannot be entered in browse mode. Is that possible either to do in a field calculation of field A  and B or in a script? If yes - how?


      If possible i would also like another feature to happen at the same time. If field C is non-empty I would like the text "WAIT" to be inserted in field A and B, but in the colour red instead of blue as the text colour normally is in these two fields. The problem is also that field A is a date field and I want, in this specific case only, to insert text. Field B is a text field - so there shouldn't be any problem inserting text in that field. How can I do this?


      Can any one help me? Hope you understand my description of my problems!

        • 1. Re: Blocking/locking a field
          Steve Wright

          You did not specify the filemaker version, if your using FM10 or FM11 you can use an OnObjectEnter script trigger for the field you want locked.


          Create a script such as Block Fields A B

          If  [ not isempty( yourtable::C  )

            Go to Field[ ]

          Exit Script []

          End If


          Set the onObjectEnter trigger for Fields A and B to run this script.  If you then tab in, or click into the field it will simply leave the field.


          For the text, perhaps you could simply type 'wait' on the layout, format it as required, then add conditional formatting such as


          Formula : isempty(yourtable::C)

          Then apply a text size of 500px


          This will cause the text to resize beyond the bounds you specify (thus becoming invisible) if field C is empty.

          If field C has a value, it will show the text