Skip to content
Auscultby NBIT
EN
Free diagnostic

Access error reference

Access error 3218: Could not update; currently locked

In a shared Access database, saving a record or running a batch update stops: the data is locked by someone else, or by the application itself.

The message

Access run-time error 3218 box
The run-time error box Access shows, in English: error number 3218 and its message.

Could not update; currently locked.

English Access

Microsoft describes it as trying to update data on a page that is currently locked, for example using the Edit method on a record that is already open or locked, or saving a query someone else is using.

Where it shows up

In code (rs.Edit, rs.Update, CurrentDb.Execute "UPDATE …"), when saving a record in a form, or when saving a modified query while others are using the database.

Common causes

  • another user is editing the same record, or a nearby record when Access locks by page;
  • the application locks itself: a form open on a record being edited, while the code changes the same record through a Recordset or a query;
  • a long batch process holding locks while others work;
  • a lock file (.laccdb or .ldb) that users cannot create or update in the shared folder.

How to reproduce and check it

  1. Note who was working on the same record or form when the error occurred.
  2. Replay alone, on a copy: if the error disappears, it is a conflict between users; if it remains, the application blocks itself.
  3. In that case, look for a form open in edit mode on the record the code updates, and save it first (If Me.Dirty Then Me.Dirty = False).

How to fix it

Save the form's record before changing it in code: If Me.Dirty Then Me.Dirty = False. Keep edits short, and let the user retry when the record is taken.

For example, in the error handler: If Err.Number = 3218 Then MsgBox "Record in use, please retry.": Resume ExitHere. Also check that every user can create and modify files in the database's folder, and that record-level locking is ticked (Access Options, Client Settings).

What Auscult reports

This conflict arises when several people work at the same time. The analysis works alone, on a copy of the database: it does not reproduce conflicts between users. If the error appears during the analysis, the application blocks itself, and the diagnostic records it with the form or button that raises it.

The Access error reference, code by code

Frequently asked questions

How many users can an Access database take without locks?

There is no fixed threshold: it depends on how the application changes data. Forms that keep a record open for a long time and batch processes during the day cause locks even with a few users.

Is splitting the database into front end and back end enough?

It is the first step: each user has their own copy of forms and code, only tables are shared. Conflicts on the same record remain possible and are handled in code.

Where are the other errors in your application hiding?

The diagnostic runs on your computer, on a copy of the application, without sending the data in your tables. The health grade and the summary are free.