Access error reference
Access error 2950: macro action failed
A button does nothing, then Access shows a macro failure box with error number 2950. That number only says a macro action failed: the real cause is elsewhere in the box, or in what Access said just before.
The message
Access shows a box naming the macro (often an embedded macro: “Button : On Click”), the failed action, its arguments and error number 2950. Under that number, the message Access returns to code that automates it carries the wrapped error, for example:
2950 Microsoft Access cannot find the referenced form '…'. — Macro name: …
Other records under the same number: “Syntax error (missing operator) in query expression …”, “Data type mismatch in criteria expression”, or nothing but the macro name.
Where it shows up
In macros, including macros embedded in buttons and form events: OpenForm, RunCode, SetValue, ApplyFilter, and so on.
Common causes
- the database is not trusted: opened outside a trusted location with content disabled, Access blocks actions it considers unsafe;
- a renamed or deleted object the action refers to (form, report, query);
- a VBA function called by
RunCodethat no longer exists, or a module that does not compile; - a bad argument: malformed criteria, wrong data type.
How to reproduce and check it
- Read the whole box: the action name and its arguments say what was requested.
- Check Access's message bar (“Some active content has been disabled”) and the Trust Center: is the database in a trusted location?
- Open the macro in Design view and run it with Single Step (Design tab).
How to fix it
Trust the database's folder (File > Options > Trust Center > Trusted Locations) rather than lowering security for the whole PC. Then fix the object or function the action refers to, just as you would the wrapped error itself.
What Auscult reports
The diagnostic does not judge 2950 by its number: it judges the error it wraps. “Cannot find the referenced form” is handled as a missing form, “missing operator” as a syntax error, and so on, with the macro and the button involved. When Access says nothing but the macro name, the item is marked “to check” rather than “broken”.