6 Replies Latest reply on Nov 28, 2011 1:27 PM by philmodjunk

    Lock layout with button

    MikeF

      Title

      Lock layout with button

      Post

       

      Would like to lock a layout, preventing any fields on it from accidental data entry.

      Not looking for security, simply accident protection [from myself as well].

      Not looking to lock individual fields, but indeed the entire form.

      It would be locked on open [layout enter], and would have a toggle button that unlocks/locks it.

      Is that easily done?

      Thanks,

        Mike

        • 1. Re: Lock layout with button
          ian.moree

          OK> Records by default are locked until you issue a commit

           

          what you can do is just make the relationship on that particular layout not valid until that button is clicked. 

          That would in essence lock the entire layout.

           

          cheers

           

          -i

          • 2. Re: Lock layout with button
            ian.moree

            [quote]It would be locked on open [layout enter], and would have a toggle button that unlocks/locks it.

            [/quote]

             

            toggle button is needed to unlock / lock ..

            • 3. Re: Lock layout with button
              Jade

              Simplest way, IMO, is to duplicate the layout and set the Field Control/Behavior on all fields to not allow entry in Browse mode on the original layout.  Then add a button on each layout to go to the alternate layout.

              • 4. Re: Lock layout with button
                RickWhitelaw
                 Have your lock/unlock button return a Boolean value (0 or 1) then attach an OnObjectKeystroke triggered script to each object (field) that disallows or allows data entry (the keystroke) depending on the value determined by the button. RW
                • 5. Re: Lock layout with button
                  ian.moree

                  So it goes to say there are numerous ways to do 1 thing within filemaker. RIGHT!!

                   

                  • 6. Re: Lock layout with button
                    philmodjunk

                    And you do not have the complete list yet. Wink

                    You can also use Manage | security to lock records. This is a lock that takes place at the data level so it, unless you get creative with the lock expression, will lock a given record on ALL layouts, not just a specific layout so it may be more of a heavy duty lock than you need. It's advantage is that no scripting or duplicated layouts are needed to implement.

                    See "Editing record access privileges" in FileMaker Help and check out this particular sub section: "Entering a formula for limiting access on a record-by-record basis" for a detailed description of how to set this up.