Skip to content
Auscultby NBIT
EN
Free diagnostic

Access error reference

Access error 2450: cannot find the referenced form (how to fix)

A button, a query or a calculated control reads a value from another form, with `Forms!FormName!Control`. If that form is not open, or no longer has that name, Access answers that it cannot find the form.

The message

Microsoft Visual Basic box: “Run-time error '2450': Microsoft Access cannot find the referenced form 'F_Commandes'.”
The real error box, captured in Access for Microsoft 365, in English: the code reads a control of the form “F_Commandes”, which is not open.

Microsoft Access cannot find the referenced form '…'.

English Access; in quotes, the form named by your application

On a French Access: « Microsoft Access ne trouve pas le formulaire « … » auquel il est fait référence. » When the application has a title, it often replaces “Microsoft Access” at the start of the message.

Where it shows up

In code (Forms!frmMenu!txtUser, Forms("frmCustomers").Requery), in a macro, in a calculated control's source, or in query criteria that read another form.

Common causes

  • the form named is not open: the code assumes the user goes through the menu, or that another form is already shown;
  • the form was renamed or deleted, and the reference keeps the old name;
  • a typo in the form name;
  • a subform addressed like a form: Forms!frmOrderLines instead of Forms!frmOrder!sfLines.Form.

How to reproduce and check it

  1. Close all forms, then open the failing one on its own: if the error appears, it depends on a form that is not open.
  2. Look for the quoted name in the Navigation Pane: if it is not there, the form was renamed or deleted.
  3. In the VBA editor, Edit, Find (Ctrl+F) across the whole project: the quoted name shows every line that refers to it.

How to fix it

Restore the form's name, or fix the reference. If the form may be closed, test it before reading it: If CurrentProject.AllForms("frmMenu").IsLoaded Then strUser = Forms!frmMenu!txtUser.

For a subform, go through the control that holds it: Forms!frmOrder!sfLines.Form!txtTotal. To pass a value, prefer the opening argument: DoCmd.OpenForm "frmDetails", , , , , , Me.txtId, read with Me.OpenArgs.

What Auscult reports

The diagnostic tries every form and button in Access and records error 2450 with the object that raises it. The report explains it as “The action calls a form or a report that does not exist, or is not open” and suggests restoring the form involved.

When a form has a name close to the one quoted, the report often gives a proposed fix, to be checked: the form with the closest name, and the line of code or the property that keeps the old name.

The Access error reference, code by code

Frequently asked questions

Why does error 2450 not happen when going through the menu?

Because the menu opens the form the code then reads. Opened straight from the Navigation Pane, or by another path, the form looks for a value in a menu that is not shown.

How do I find every reference to a renamed form?

Search for the old name in the whole VBA project, then in macros, queries and control sources. Code is not the only place where a form name is written.

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.