Security at Record Level

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

Guest

I need to put some security at record level, in the event that two people
could be tryin gto edit one record at the same time, I raised a question
previouly on this but got no answers, does anybody know if I need to
configure some switches to allow this to happen, i need more than one person
to be able to open the one DB on a network, but I want to prevent them
editing the same record and the same time
 
I need to put some security at record level, in the event that two people
could be tryin gto edit one record at the same time, I raised a question
previouly on this but got no answers, does anybody know if I need to
configure some switches to allow this to happen, i need more than one person
to be able to open the one DB on a network, but I want to prevent them
editing the same record and the same time

You can try various combinations of the record locking methods of Access, but you'll still likely get record locks if
two users attempt to edit the same record. There is no "security" setting which will circumvent this.

You could add a Yes/No field to your tables (perhaps bLocked), and check that before you allow a user to edit the record
.... so something like this:

Sub Form_Current()
Me.AllowEdits = Not Me.bLocked
End Sub

Sub Form_Dirty()
Me.bLocked=True
End Sub

Sub Form_BeforeUpdate(Cancel As Integer)
Me.bLocked=False
End Sub

This is fraught with troubles, however ... for example, if something happens while a user is editing the form (like a
network glitch), the bLocked column could be locked at True ... you'd have to manually change that so users could again
edit the form.

The safest way is to use unbound forms and handle all data edits yourself ... this way, you can use the same basic
logic, but YOU handle all data updates and such ... of course this also means a good bit more development work.
Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
Scott,

Thank you for that, that was very helpful, I decided in the end to put No
Locks, in the Properties behind the form. I tested it and it does not allow
any edits to the record in question if it is already open for edit. I live in
hope that when the DB is used over a network, that no records will become
damaged or the DB itself..

Thank you
 
Back
Top