How do I protect data in Access at the field level within a form?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In a multi-user environment, it is possible to set up one field only (a notes
field) in a form to lock or protect the data either when saved or exited so
that it can be ammended but not deleted or changed?
 
On Tue, 24 Oct 2006 12:50:02 -0700, Shelley White <Shelley
In a multi-user environment, it is possible to set up one field only (a notes
field) in a form to lock or protect the data either when saved or exited so
that it can be ammended but not deleted or changed?

Could you explain what you mean by "amended... but not changed"?

You can use the Form's Current event:

Private Sub Form_Current()
Me.txtNotes.Locked = Not Me.NewRecord
End Sub

This will set the Locked property of the textbox txtNotes (bound to
the Notes field) to False if you're on the new record, or to True if
you're not; this would allow you to enter a note when the record is
first created but not modify it thereafter (at least not using the
Form, you'll need Access security to prevent users from opening the
table directly or running an update query).

John W. Vinson[MVP]
 
John, thank you for your reply. I just realized my typo led to confusion
(ammended should have been appended). I have staff that are adding to a
Notes field. Within the same "notes" field I want to be able to protect
previous entries but allow staff to add to the notes. Will you solution
below solve this?
 
Back
Top