469,125 Members | 1,685 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,125 developers. It's quick & easy.

Identify a Locked Record?

23
I have set the Record Locked property to Edited Record so only one user can make changes at a time (using Access 2003). The circle with the line through it appears but everyone is freaking out that they can't make changes. The MS message doesn't appear that lists three choices which is fine because I don't want to allow them to do anything but move on to a different record until the person with the record open is done.

So, what I need to do is send a message box explaining that the record is locked and you have to wait. I would like to put this on the OnCurrent, or other event, but do not know how to write this IF statement, I'm not a programmer. How do you identify a locked record? (If ??what?? is locked then msgbox, etc.)Thanks for the help.
Feb 17 '11 #1
8 4479
NeoPa
32,161 Expert Mod 16PB
A tricky one this.

I found Me.Recordset.EditMode, but it only seems to recognise the status as set by the current process. IE. It doesn't get updated to show when another process is updating the record, as I think you require.

Sorry I couldn't be more help, but I'll keep an eye on this thread in the hope that someone manages to find an answer. Interesting.
Feb 17 '11 #2
AnnMV8
23
Thank you. I appreciate all the help I can get and will look at Me.Recordset.EditMode to understand what it is and does.
Feb 17 '11 #3
NeoPa
32,161 Expert Mod 16PB
No worries Ann. I've sent out a call for assistance on this one, so I hope we can get a more useful answer for you.
Feb 17 '11 #4
AnnMV8
23
I looked at the Me.Recordset.EditMode which referenced the EditModeEnum and it's values. Is it possible to program an IF statement that says if it's any of the Constants with their corresponding Value don't do anything, otherwise, send the message? I'm just guessing here since I'm not a programmer.
Feb 17 '11 #5
NeoPa
32,161 Expert Mod 16PB
When I found it, I tested it with records that were locked as well as unlocked (not both at the same time of course), and the state returned was zero (0) in both cases. From this I would say that is not a viable working hypothesis. Sorry.
Feb 18 '11 #6
mshmyob
904 Expert 512MB
Would having a user try editing the record and if it is locked then trap the error and display a message indicating the record is locked.

cheers,
Feb 18 '11 #7
AnnMV8
23
Unfortunately, I don't know. I'm not a programmer so that is why I was hoping to get it done with an IF statement and a message box, I can write some of those.
Feb 18 '11 #8
NeoPa
32,161 Expert Mod 16PB
Trapping the error is always a possibility (look up On Error in Help), but I always feel it's preferable, where possible of course, to get the information without having to crash through an error. That can work of course, and failing a more direct solution, would be one I'd use, but error handling can get messy in some circumstances. It's the best solution so far still, of course ;-)
Feb 19 '11 #9

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Dudley Joseph | last post: by
6 posts views Thread by DebbieG | last post: by
4 posts views Thread by William Bradley | last post: by
1 post views Thread by pj | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.