Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    228

    Unanswered: Detect which records are being accessed

    I have a backend that is accessed by multiple people. Currently I have a function that goes to the first record and then keeps going to the next record until the last record is reached. Along the way I trap the access error that occurs when the record is already locked by another user. Once this is done I display a message box with the record numbers where the records were being accessed.

    And finally my question is, can this be done behind the scenes without me actually going from record to record? Hey, at least I don't click the next record button hundreds of times any more...

    A majority of time people are accessing a record assigned to them so I can call them up and boot them off if I have to do maintenance. It is a minority of the time that a person just sits on a random record and then I have to send out an email to the whole company =(

  2. #2
    Join Date
    Jun 2004
    Location
    Terrapin Nation
    Posts
    205
    If you have the code to trap the fact that the record is shared you are more than halfway there.


    All you have to do is loop through the table:

    Dim db as dao.Database
    Dim rst as dao.Recordset

    Set db = CurrentDb
    Set rst = db.OpenRecordset("Your table or recordset", dBOpenTable)

    with rst
    .movefirst
    while not .eof
    '''your code here
    .movenext
    wend
    end with

  3. #3
    Join Date
    Sep 2003
    Posts
    228
    I have a loop that "physically" loops from the first record to the next.

    My trapping code works via the "on current" event. I don't think I will generate errors just by looping the record set. My thinking is I have to try and open each record for writing to generate the error that occurs when somebody else already has that record open... am i write or wrong?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •