Identify a Locked Record?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AnnMV8
    New Member
    • Feb 2010
    • 23

    Identify a Locked Record?

    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.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32668

    #2
    A tricky one this.

    I found Me.Recordset.Ed itMode, 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.

    Comment

    • AnnMV8
      New Member
      • Feb 2010
      • 23

      #3
      Thank you. I appreciate all the help I can get and will look at Me.Recordset.Ed itMode to understand what it is and does.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32668

        #4
        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.

        Comment

        • AnnMV8
          New Member
          • Feb 2010
          • 23

          #5
          I looked at the Me.Recordset.Ed itMode 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.

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32668

            #6
            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.

            Comment

            • mshmyob
              Recognized Expert Contributor
              • Jan 2008
              • 903

              #7
              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,

              Comment

              • AnnMV8
                New Member
                • Feb 2010
                • 23

                #8
                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.

                Comment

                • NeoPa
                  Recognized Expert Moderator MVP
                  • Oct 2006
                  • 32668

                  #9
                  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 ;-)

                  Comment

                  Working...