VBA detection of locked records

Leif

Registered User.
Local time
Today, 09:19
Joined
Jan 20, 2011
Messages
79
I have a 2003 database that is set for record-level locking.

I have a form set for locking the edited record.

I also have an unbound form to edit a field in the record. I pass the control to the form and it displays the content of the field (in a large window).

This works fine until you have two users editing the same record. The first user starts the edit, the second user also start an edit on the same record using the form. When the user exits the form the coding tries to assign the content to the record. This is when the user gets the error - 3218, "Could not update; currently locked."

I can trap the error and give the user the bad news that their update cannot be saved. However, I would prefer to inform the user that the record is locked and they may not update the record right now.

Is there a way to detect, via VBA, that another user has locked the current record?

Thanks,
Leif
 

Users who are viewing this thread

Back
Top Bottom