Skip to content
Auscultby NBIT
EN
Free diagnostic

Access error reference

Access error 3265: item not found in this collection

The code stops on “Item not found in this collection”. It asked Access for a field, a table or a query by name, and that name does not exist — or no longer exists — where it is looking.

The message

Microsoft Visual Basic box: “Run-time error '3265': Item not found in this collection.”
The real error box, captured in Access for Microsoft 365 in English: the code reads a “Telephone” field the table does not have.

Run-time error '3265': Item not found in this collection.

English Access

On a French Access: « Élément non trouvé dans cette collection. » The message does not quote the name at fault: the line highlighted by the debugger does.

Where it shows up

In DAO code that refers to an item by name or position: rs!CustomerName or rs.Fields("CustomerName") on a recordset, CurrentDb.TableDefs("Customers"), CurrentDb.QueryDefs("qrySales"), qdf.Parameters("[Start date]"), tdf.Indexes("PrimaryKey"), or rs.Fields(i) past the last field.

Common causes

  • a renamed field in the table or query, while the code still uses the old name;
  • a field missing from the query behind the recordset: SELECT CustomerID, Name FROM … then rs!City;
  • an alias or an expression: SELECT FirstName & ' ' & LastName AS FullName … is read as rs!FullName; without an alias, Access names the column “Expr1000”;
  • two joined tables with a field of the same name: the column is then called Customers.City, and rs!City fails;
  • a deleted or renamed table or query, called through TableDefs("…") or QueryDefs("…");
  • a misspelled parameter: the name passed to Parameters must be exactly the query's, brackets included.

How to reproduce and check it

  1. Click “Debug” when the message appears: the highlighted line contains the name being looked up.
  2. List what the collection really contains, in the Immediate window: For Each f In rs.Fields : Debug.Print f.Name : Next.
  3. Compare with the name in the code; for a table or query, check in the Navigation Pane that it exists under that exact name.

How to fix it

Use the real name, or add the field to the source query. Give every expression an explicit alias and qualify ambiguous fields. When an item may legitimately be missing (a temporary table, a query created by code), check that it exists before using it.

What Auscult reports

The diagnostic records 3265 wherever Access returns it during the run, with the form, report or button whose code stops. When several forms hit the same missing name, that is one cause: the report counts it once and lists the forms affected.

The Access error reference, code by code

Frequently asked questions

The field is in the table: why the error?

Because the code reads the recordset, not the table. If the query that opens it does not select that field, or renames it with an alias, it does not exist in the Fields collection.

The error appeared after moving the tables to SQL Server: is it related?

Often. Linked tables sometimes get another name (a “dbo_” prefix) and some fields are renamed or change type. Code that calls TableDefs("Customers") or a field by its old name no longer finds them.

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.