Locking Records

G

G

I'm using Access 2000. I have a form that users will use to fill out various
fields. I would like create another form or datasheet where the manager can
simply tick off ( there is a column field for this tick) records which will
effectively lock that record. So that a normal user cannot alter/change any
field of that record. Its simply associating that tick to freezing the
record.
I don't necessarily want to introduce the logon restrictions that access can
facilitate.
thanks.
 
T

Tom Wickerath

On the form that you wish to lock records, you have a couple of options:

1) Base the recordset on a query that filters out all the checked records. This way, the
"normal users" won't even see those records displayed. This has the advantage of reducing
network traffic, since you're not pulling records over the wire that they shouldn't touch.
On the other hand, if they still need to see the records, then this strategy may not be
the best.

2) Another method you can use is programmatically set the form's Allow Edits and Allow
Deletions properties in the Form_Current() event procedure. Here is a procedure that
works in the Northwind sample database, using the Products form. The check box used to
indicate discontinued products in named "discontinued" (not my choice of a good naming
convention, but that's beside the point):

Private Sub Form_Current()

With Me
.AllowEdits = Not Me.Discontinued
.AllowDeletions = .AllowEdits
End With

End Sub


Tom
_________________________________________


I'm using Access 2000. I have a form that users will use to fill out various
fields. I would like create another form or datasheet where the manager can
simply tick off ( there is a column field for this tick) records which will
effectively lock that record. So that a normal user cannot alter/change any
field of that record. Its simply associating that tick to freezing the
record.
I don't necessarily want to introduce the logon restrictions that access can
facilitate.
thanks.
 

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

Top