Restricting edits on one field in a table

  • Hello folks

    I need a little help:

    I have an Access front-end and SQL back-end and I need to restrict a column in a table. 

    I need to be able to have the users enter the initial data in one field called Service Tag Number

    from an Access form.  After the data has been entered and saved, I need to restrict them from updating or

    deleting that data.  They can modify or delete any of the other entries on that form but not the

    Service Tag number.

    An Instead of trigger would be great but it restricts the entire table not just the one field. 

    Here is the trigger I tried:

    CREATE TRIGGER [Trig_TagMod]

    ON Workstation

    INSTEAD OF UPDATE, DELETE

    AS

    BEGIN   

     PRINT ('Modifications or Deletions are not allowed in this field')

    END

     

    Any help or direction would be most appreciated.

     

  • You might be best off controlling this via the MS Access front end. A little VB to lock the field once there's a valid value in there could go a long way. A trigger probably isn't the most graceful way to handle this.

    You can also explicitly deny UPDATE on the column.

  • Another senior moment.  The Deny works fine.  Just one of those days.

     

    Thanks for pointing me in the right direction.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply