You can encounter the runtime error 3022 in MS Access, while modifying the records into an existing table or using the VBA code to access the objects within a database.
This error code is usually accompanied by the “The changes you requested to the table were not successful” message.
This error can appear if the database’s specification sets, such as field mappings, data types, formatting options, conditions, and parameters, are damaged.
However, there could be many other reasons behind this error.
In this article, we’ll discuss the methods to fix the error 3022 in MS Access.
Causes of the Access Runtime Error 3022
This error can occur due to one of the following reasons:
- When using the primary key’s AutoNumber field with an incorrect seed value
- Damaged specifications set
- Corrupted tables in the database
- Inserting a record with the value same as the primary key value
Methods to Fix the Access Runtime Error 3022
The error 3022 in MS Access can occur due to a damaged specification set. In such a case, you can compact the specification set as recommended in the Microsoft guide.
If it does not resolve the error, then you can try exporting components into a new specification set.
If this is not the case, then follow the below methods.
Step 1: Reset AutoNumber Field
The Access database error 3022 can occur if the AutoNumber field is seeded incorrectly. You can reset the AutoNumber field to troubleshoot this error. There are two ways to reset the AutoNumber field - using data definition query and using VBA code.
Steps to reset the AutoNumber field using Query:
- In the Access database, click the Create tab and then Query Design.
- The Show Table window is displayed. Click Close.
- On the Design tab, click SQL View and then select SQL View.
- Under Query1 window, type the below query:
ALTER TABLE Table1 ALTER COLUMN AutoNumFieldName COUNTER(iMaxID,1);
- On the Design tab, click on the Run option.
Alternatively, you can use VBA code to reset AutoNumber field.
Here’s how:
- In the affected database, click Create and then click Class Module.
- In Microsoft Visual Basic for Applications window, type the below code:
VBCopy
Sub ResetAuto()
Dim iMaxID As Long
Dim sqlFixID As String
iMaxID = DMax("<AutonumberFieldName>", "<TableName>") + 1
sqlFixID = "ALTER TABLE <TableName> ALTER COLUMN <AutonumberFieldName> COUNTER(" & <iMaxID> & ",1)"
DoCmd.RunSQL sqlFixID
End Sub
- Click Run and then select Run Sub/UserForm option.
Step 2: Run the Compact and Repair Tool

If the Access database error 3022 has occurred due to corruption in the database, then you can try the Microsoft built-in utility to repair the database file.
Here’s how to run this utility:
- Open the Microsoft Access application.
- Double-click on the Blank desktop database option.
- Click File and then click Close.
- In the Blank Database window, click on the File tab.
- Under Database Tools, click Compact and Repair Database.
- Choose the database (in which you are getting the 3022 error) and click Compact.
- Once the repair process is complete, a compacted and repaired copy of the database will be saved at the same location where it is stored.
Step 3: Use a Professional Access Recovery Software
If the Compact and Repair tool fails to repair the database, then you can use an advanced Access recovery software, such as Stellar Repair for Access.
It can repair highly corrupted/damaged database files with ease. It can help you recover tables, forms, macros, modules, fields, etc., from the corrupted database without changing the original formatting.
The software is compatible with Windows 7, 8, 10, and 11 and supports all versions of MS Access.
You can download the software’s demo version to check its accuracy.
The Access database error 3022 - “The changes you requested to the table were not successful" can occur when using incorrect queries while inserting values in the form.
You can recreate the damaged specification set or reset the AutoNumber field to troubleshoot the error.
If the error has occurred due to corrupted tables in the database, then you can use an advanced Access database repair software, like Stellar Repair for Access.
This software can repair both .MDB and .ACCDB files, and restore all the objects from the affected file.