Lock an individual record being worked on in a Form

  • Thread starter elliottpt via AccessMonster.com
  • Start date
E

elliottpt via AccessMonster.com

Hi

Could anyone please help me out; I need to lock an invidual record that is
being worked on in a form sothat other users will not be able to access it
while it is being edited. I have used the below syntax but it yield the
following error:

"Compile error:
Method or data member not found"

Here's the code as I used it:

Private Sub Form_Current()

If Me.Lock = True Then
Me.AllowEdits = False
ElseMe.AllowEdits = True
End If

The Private Sub Form_Current is highlighted Yellow.

Would also be nice if someone could show me how to include an error message
to say "Mister
X is currently editing the record" or something of the likes.

Thanks
 
T

Tom van Stiphout

On Fri, 24 Oct 2008 06:28:28 GMT, "elliottpt via AccessMonster.com"

Take all of that code out and set the form's RecordLocks property to 2
= Edited Record.

Mind you, I don't use this but in very rare cases, because No Locks is
typically just fine in multiuser apps.

-Tom.
Microsoft Access MVP
 
E

elliottpt via AccessMonster.com

Thanks so much...
Take all of that code out and set the form's RecordLocks property to 2
= Edited Record.

Mind you, I don't use this but in very rare cases, because No Locks is
typically just fine in multiuser apps.

-Tom.
Microsoft Access MVP
[quoted text clipped - 22 lines]
 

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