none
"Could not update record, locked by another session on this machine" message RRS feed

  • Question

  • What could cause this message?

    Here is the code:

    Private Sub SaveRecord_Click()
    On Error GoTo ER
       ' Force Form_BeforeUpdate
       If Me.Dirty Then Me.Dirty = False
       ' Just save record, don't exit
       Exit Sub
    ER:
       MsgBox Err.Description, , "SaveRecord_Click"
    End Sub

    Thursday, November 29, 2018 9:59 PM

All replies

  • That usually means that you have more than one instance of Access running, and the other instance has the record locked.  Sometimes the other instance is not visible, but is running in the background.  I've known that to happen when an automation failure has left an instance running, unbeknownst to me.

    If you look in Task Manager, do you see more than one instance of msaccess.exe among the processes?


    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

    Thursday, November 29, 2018 10:55 PM
  • maybe put in the: End If 

    perhaps with it explicit before or after the: Exit Sub     maybe resolves some ambiguity….

    guessing... may not help at all......

    Sunday, December 2, 2018 3:39 PM
  • maybe put in the: End If 

    perhaps with it explicit before or after the: Exit Sub     maybe resolves some ambiguity….

    guessing... may not help at all......


    No End If is required or accepted with a one-line If statement; only  with an If block.

    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

    Sunday, December 2, 2018 8:12 PM
  • User didn't check Task Manager before he closed and re-opened the database but I asked him to check that if the error re-occurs. Thanks for the response.
    Wednesday, December 5, 2018 12:35 AM