How do I lock multiple records in a form while leaving data visibl

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

Guest

Access 2003 - I have 2 main forms, a data enty form and an auditors form
I would like to create a checkbox so the auditor could lock the data on
multiple records to prevent just those records from being edited.
The data entry clerk would still needs to view those records, but would only
be able to edit unlocked records and create new ones.
This is a small database with only 3 users.
 
Add a boolean (yes/no) field, lets call it "LockField" to your table. In the
form's On Current event, add some code like:

Sub Form_Current()
If Me.chkLockField = True Then
Me.AllowEditing = False
End If
End Sub

This will not lock the table, only the form. If you need to lock the table,
you'll need to use User-Level Security.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
If you add a yes/no field to your table to store wether or not that record
should be locked, then add it to the form, and in the on current event put
Me.allowedits = not me![Name of new field]

If the fiel is checked (true) then the forms allow edits property will be
false and the data will not be able to be changed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top