Access error reference
Access error 7874: Microsoft Access can't find the object (fix)
A button runs a query, opens a table or runs a macro, and Access answers that it can't find the object. The name quoted does not exist, or no longer exists, in the Access database.
The message

Microsoft Access can't find the object '…'.
On a French Access: « Microsoft Access ne peut pas trouver l’objet « … » ». The English version sometimes puts a full stop just before the closing quote.
Where it shows up
Mostly with DoCmd: DoCmd.OpenQuery, DoCmd.OpenTable, DoCmd.DeleteObject, and in a button's macros (OpenQuery, OpenTable).
Common causes
- the object was renamed or deleted, and the code or macro keeps the old name;
- a typo, an extra space or character in the name;
- the object is in another file: a back-end table that was never linked, or a query left in an older version;
- a name built by the code (
"qry" & strType) that gives a non-existent name for some values.
How to reproduce and check it
- Copy the name quoted in the message and look for it in the Navigation Pane, showing all objects.
- In the VBA editor, search for that name across the whole project (Ctrl+F), then in the buttons' macros.
- If the name is built by the code, print it before the call:
Debug.Print strQuery.
How to fix it
Restore the object or fix the name. For a variable name, check it exists before use, with a small function: On Error Resume Next: Set qdf = CurrentDb.QueryDefs(strQuery): Exists = (Err.Number = 0).
For a back-end table, relink it (External Data, Linked Table Manager) rather than changing the code.
What Auscult reports
The diagnostic records error 7874 with the button or macro that raises it. The report explains it as “A table or query that is needed cannot be found: deleted, renamed, or kept in a data file that did not come with the application” and suggests restoring it or removing what is no longer used.
When an object has a name close to the one quoted, the report often gives a proposed fix, to be checked: the object with the closest name (a likely typo or rename), and the line of code that keeps the old name.
Related errors
- 2450 — can't find the referenced form, the same fault for a form
- 3061 — too few parameters
- 2950 — macro action failed, the box that often wraps 7874 in a macro
- The Access error reference, code by code