2 Replies Latest reply on Aug 8, 2011 2:13 AM by MajorPaine

    Conditional Access to Field?

    MajorPaine

      Title

      Conditional Access to Field?

      Post

      Is there a method to limit access to a field according to the value in another field?

      Ex: On a Personal Record form I have a 'Status' value from a Value List (Active, Terminated) and I want to have another field 'Eligible for Rehire' since there are cases where 'Terminated' could be under favorable conditions.

      Obviously the 'Eligible for Rehire' should only be accessible IF Status = Terminated.

      Programatically, the event should occur after a change to the Status field.

      Appreciate comments, suggestions

        • 1. Re: Conditional Access to Field?
          philmodjunk

          You can set up a validation rule that will refuse changes to the "Eligible for Rehire" field if the status field does not equal "Terminated". That does permit access and edits to the field, but rejects them when the user exits. Not a perfect option, but easy to set up and this set up automatically controls changes to the field on every layout where you place it.

          You can use a ObjectEnter script trigger on the "Eligible" field that checks the value in status, using Go To Field or Go to Object to move the cursor to another object on your layout to deny access to the field. This prevents changes entry to the field, but as to be consistently set up the same way each time you place a field on a layout.

          Please note that both of the above options can be employeed. The script trigger makes things more user friendly. The validation rule serves as a "safety net" to catch any loopholes you forget to plug with your script trigger.

          It's also possible to use Access Privileges to control access to this field, but since the lowest level of access FileMaker can control is to a table, not to a specific field, you'd have to place this field in its own table with a one to one relationship to the current table before you could selectively control access to just this one field. That's probably not worth the effort here.

          • 2. Re: Conditional Access to Field?
            MajorPaine

            Thanks Phil,

            Sounds like the validation rule is the easiest to employ BUT the ObjectEnter script trigger sounds more like what I would be used to from VB programming.

            The part about having to set it up that way for every layout doesn't bother me at all. That's actually preferential from my experience in toubleshooting, hate to have global parms on an obj that might be used elsewhere. Prefer keeping those parms local.

            I'll give them both a shot; good way to learn for the future.

            Thanks for the assistance & tips.