2 Replies Latest reply on Dec 15, 2011 5:21 PM by tman1425

    Prevent records from being edited?



      Prevent records from being edited?


      I have done a lot of searching on this and can't seem to figure it out.  My knowledge is very limited.  Essentially, I want to be able to click a "Lock" button which will prevent any additional data input.  Then when I click the button again, it allows data input.  Does anyone have simple step-by-step instructions on how to do this?  I cant figure out how to set up the fields and privelges, etc.  Also, I have absolutely no idea how to set up a script for this.

      If anyone has any ideas for me, I would really appreciate your input.


        • 1. Re: Prevent records from being edited?

          Make a back up copy of your file just in case you make a mistake and have trouble accessing your database.

          Use this script for your lock button:

          Set Field [YourTable::LockField ; not YourTable::LockField ]

          Click the "run with full access privileges" check box if you want limited access users to be able to unlock the record after it is locked.

          Where LockField is a number field. This script will toggle the value in this field between 1 (locked) and 0 (unlocked).

          In Manage | Security, bring up an account with a privilege set where you want this "lock" method to work.

          Specify custom privileges for Reords, select your table in the list that appears and select "limited..." in the edit drop down.

          Enter this calculation as the lock expression:

          Not LockField

          make the same choices in the Delete drop down if you want to prohibit deleting locked records.

          Click OK until you have left manage | security.

          Close and reopen the file, using an account name and password associated with this privilege set. And now you should be able to lock and unlock records in this table.

          • 2. Re: Prevent records from being edited?

            Thank you.  You are such a big help!  What is the best way to be able to tell if the fields are locked or unlocked?  Is there any way to specify some sort of a "locked" indicator or something?