Skip to content
Auscultby NBIT
EN
Free diagnostic

Access error reference

“Can't find project or library”: fixing a MISSING reference in Access VBA

The error often highlights an innocent built-in function — `Left`, `Date`, `Format`. The real cause is a reference in the VBA project that points to a library that is not on this PC.

The message

Compile error: Can't find project or library

English Access

On a French Access: « Projet ou bibliothèque introuvable ». In the VBA editor's Tools > References, the culprit is labelled “MISSING:”.

Where it shows up

When compiling, or when the first form whose code uses any function opens: a single missing reference stops VBA from resolving other names, hence built-in functions that suddenly “can't be found”.

Common causes

  • a component installed on the author's PC but not yours: ActiveX control, third-party library, an older version of an Office library;
  • a library that only exists in 32-bit, on 64-bit Office (for example the old DAO 3.6 library, some ActiveX controls);
  • a component Office no longer ships: the Calendar control (removed since Access 2010), Office Web Components;
  • a moved or renamed file (another Access database referenced as a library).

How to reproduce and check it

  1. Open the VBA editor (Alt+F11), then Tools > References: the ticked line marked “MISSING:” is the cause.
  2. Note the name and path shown at the bottom of the dialog: they tell you which file is missing.
  3. From code, For Each r In Application.References : If r.IsBroken Then Debug.Print r.Name, r.FullPath lists broken references.

How to fix it

Untick the missing reference. If the code needs it, tick the version installed on the PC (for DAO 3.6: “Microsoft Office … Access database engine Object Library”), or switch that code to late binding (CreateObject) so it no longer depends on a specific version. Then compile (Debug > Compile) to check nothing is left.

What Auscult reports

The diagnostic reads the project's references and knows which are broken. It separates three cases: a library missing on the analysis PC but probably present on yours (reported separately; the object is not judged without it); a library that only exists in 32-bit, broken for every 64-bit Office user (“fails on 64-bit Office”); and components Office no longer ships, flagged for removal.

Measured on our test corpus: this message was recorded while analysing 12 of 965 applications.

The Access error reference, code by code

Frequently asked questions

Why does Access flag an error on “Left” or “Date”?

Because a missing reference stops VBA from resolving every name in the project, including those from intact libraries. Fixing the reference makes those false errors disappear at once.

It works on a colleague's PC but not on mine: same error?

Very often. The component is installed on their PC and not yours, or you have 64-bit Office and they have 32-bit.

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.