Situation: You know there will be multiple users, and your application has some data entry forms. You don't want users to overwrite a record that someone else is editing.
Resolution: You want to set the Application to pessimistic Locking. This means that once a user looks at a record, it's locked up and only that user can make changes.
How To:
1. Stick this in your module.
Public Sub SetRecLocks()
'This command sets "Pessismistic" locking.
'If someone is poking around in a given record, no one else can edit it.
Application.SetOption "Default Record Locking", 2
End Sub
2. Presuming you've got a form that always opens at startup, stick this event driven piece in it
Private Sub Form_Load()
SetRecLocks
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.