Access error reference
Access error 2001: you canceled the previous operation
Nobody canceled anything, yet Access says “You canceled the previous operation”. The message is misleading: an operation failed — most often a `DLookup`, a `DCount` or a filter — and Access reports it as interrupted.
The message

Run-time error '2001': You canceled the previous operation.
On a French Access: « Opération annulée. » (Microsoft 365) In a macro, it appears in the “Action Failed” box, under the action that failed (SetLocalVar, RunCode…).
Where it shows up
Mostly on a line that calls a domain aggregate function: DLookup, DCount, DSum, DMax, DFirst… Also on Me.Filter followed by Me.FilterOn = True, DoCmd.ApplyFilter, and in the embedded macros of buttons that compute a value with DLookUp before opening a form or checking a password.
Common causes
- a wrong field name in the first argument:
DLookup("[Unit Price]", "Products", …)while the field is calledUnitPrice; - a malformed criteria in the third argument: an empty control (
"[CustomerID]="), text without quotes, a control name pasted inside the quotes; - a domain (second argument) that fails: a source query that is itself in error, or that expects a parameter;
- a filter that refers to a field missing from the form's record source;
- more rarely, a real interruption: a form event that cancels (
Cancel = True) or Ctrl+Break during execution.
Measured on a French Access for Microsoft 365: a DLookup that refers to a missing field stops there on error 2471 (the expression you entered as a query parameter produced an error), and an empty criteria on error 3075. Error 2001 remains the message of a cancelled prompt: Access asks for the value of a name it does not know, and the user clicks “Cancel” — for example when a form's filter refers to a deleted field and the code changes the sort order.
How to reproduce and check it
- Click “Debug”: spot the domain function or the filter on the highlighted line.
- Test each argument in the Immediate window (Ctrl+G):
? DCount("*", "Products")checks the domain, then add the field, then the criteria. - Print the criteria built (
Debug.Print strWhere): an empty value or a missing quote stands out.
How to fix it
Fix the field or domain name, put names in brackets, and build the criteria with the value outside the quotes, in the right format for its type. Test the control before the call: an empty criteria is the most common cause.
What Auscult reports
The diagnostic files 2001 among cancellation errors, like 2501: they are counted separately as “to confirm” and do not weigh on the score, because a cancellation can come from the application itself.
Related errors
- 2501 — the OpenForm action was canceled, Access's other cancellation message
- 2465 — Microsoft Access can't find the field, often the real cause behind a DLookup
- 3464 — data type mismatch, a criteria whose value has the wrong type
- 3075 — syntax error (missing operator), an empty criteria
- The Access error reference, code by code