locking records

bast

New member
Local time
Today, 13:36
Joined
Jun 9, 2009
Messages
1
Hi,

I am a newbie to access. I am trying to prevent a user from accessing a record that is already in use by another user. I have adjusted the forms etc to editable records, but am still getting instances where users access the same record, especially if they click move to next record at the same time...

Is there a way around this?

Cheers
 
And my suggestion for you is that you create a field as tag on the table where your form's record source. therefore on_open event if that tag is set to yes then you can make a statements in your code to prevent edits.

and after the first user finishes his transaction on that form, on_close of the form, set the tag to No so others may use it.
 
Last edited by a moderator:
does it matter that two users have the same record open. the problem really affects readers/writers

now in theory you can have any number READING/VIEWING the same record, as none of them are trying to change it.

the problem comes with inconsistent updates when two users try to modify the same record at the same time. In fact, Access deals with this automatically by telling one of the users that the record has changed. Having said this you can implement a record-locking strategy.

The trouble with record locking is that one user can [AND WILL] open a record, lock it, and then go to lunch paralyisng your system, so you need a way of overcoming this.

The general principle of multi user system is based on the premise that clashes are unlikely, not likely. Are you sure you have two users with the same record. sometimes this can happen if one user has 2 forms open, showing all or parts of the same record - and it actually comes back to improving the system design.

In general record locking is not necessary - ~I have built many complex systems, and never needed it
 

Users who are viewing this thread

Back
Top Bottom