How many fields can be contained in a access table?
Answers
Answer:
Skip to main content
Global navigation
Office Office Products Troubleshooting Access Can't save a table after updating a field
"Too Many Fields Defined" error when you save a table in Access
12/10/2019
3 minutes to read
Applies to:
Access for Office 365, Access 2019, Access 2016, Access 2013, Access 2010, Access 2007
In this article
Symptoms
Cause
Resolution
More information
References
Moderate: Requires basic macro, coding, and interoperability skills.
This article applies only to a Microsoft Access database (.mdb).
Symptoms
When you save a table after you add a new field or change the properties of an existing field, you receive the following error message:
Too many fields defined.
This message is followed by:
Errors were encountered during save. Data types were not changed.
You receive these messages even though you have 255 or fewer fields defined in the table.
NOTE You also receive this message if you add or modify fields in a report that is based on a table that has too many fields.
Cause
The internal column count that Microsoft Access uses to track the number of fields in the table has reached 255, even though you may have fewer than 255 fields in the table. This can happen because Access does not change the internal column count when you delete a field. Access also creates a new field (increasing the internal column count by 1) for every field whose properties you modify.
Resolution
To free the internal column count for deleted fields or for fields whose properties you modify, do one of the following:
Compact the database. To do so, point to Database Utilities on the Tools menu, and then click Compact and Repair Database.
Create a new copy of the table. To do so, follow these steps:
Make note of any relationships with the table.
Select the table.
On the File menu, click Save As.
In the Save Table 'table name' To box, type a new name, and then click OK.
Select the same table that you selected in step 2, and then press DELETE.
Rename the table that you saved in step 3 to the original table name.
Re-establish any relationships with the new table.
More information
In Access, you can define up to 255 fields in a table. If you create 255 fields and then delete 10, Access does not release the fields from the internal column count. Also, for every field whose properties you modify, Access creates a new field and does not release the original field from the internal column count.
Steps to Reproduce the Behavior
Note
The sample code in this article uses Microsoft Data Access Objects. For this code to run properly, you must reference the Microsoft DAO 3.6 Object Library. To do so, click References on the Tools menu in the Visual Basic Editor, and make sure that the Microsoft DAO 3.6 Object Library check box is selected.
Create the following Visual Basic for Applications code to create a new table with 255 fields:
VB
Copy
' ****************************************************************
' Declarations section of the module
' ****************************************************************
Option Compare Database
Option Explicit
' ****************************************************************
' The Fill_Table() function creates a table in the current database
' named Field Test with 255 fields, each of which has a Text data
' type and a size of one character.
' ****************************************************************
Function Fill_Table()
Dim mydb As DAO.Database
Dim tbl As DAO.TableDef
Dim fld As DAO.Field
Dim i As Integer
Set mydb = CurrentDb()
Set tbl = mydb.CreateTableDef("Field Test")
For i = 0 To 254
Set fld = tbl.CreateField("Field" & CStr(i + 1))
fld.Type = dbText
fld.Size = 1
tbl.Fields.Append fld
Next i
mydb.TableDefs.Append tbl
End Function
Type the following line in the Immediate window to run the function and to create the table:
VB
Copy
Fill_Table
View the Field Test table in Design view, and then delete the last field so that there are only 254 fields defined in the table.
Add the field again, and try to save the table. Note that you receive the following error messages:
adoc
Copy
Too many fields defined.
Errors were encountered during the save operation. Fields were not added. Properties were not updated.
References
For more information about database specifications, click Microsoft Access Help on the Help menu, type Access specifications in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.
Is this page helpful?
Yes No
Feedback
Send feedback about
Loading feedback...
English (United States)
Previous Version Docs Blog Contribute Privacy & Cookies Terms of Use Site Feedback Trademarks
hlo mate ✌️
255 fields
In Access, you can define up to 255 fields in a table. If you create 255 fields and then delete 10, Access does not release the fields from the internal column count.
Hope it helps.