Index or primary key cannot contain Null value, Access

The error “Index or primary key cannot contain Null value“, occurs when you have left the primary key (index) field empty:
Error
Every table in an Access database must have a primary key, and the primary key value for each record must be unique.

The reason you are getting this error is because there is record in the database where this field has been left empty. This error normally occurs when you have changed the default data type of the primary key (Index) from Autonumber to another data type. In order to solve this issue you will need to figure out the primary key (index) field, and fill it with a unique value.

Select the table that is generating this error and open it in design view:
Primary Key
The primary key (Index) field will have a key next to it.

After figuring out the primary key (index) field, remember not to leave it blank:
Primary key , Empty

If you need assistance with your code, or you are looking for a VBA programmer to hire feel free to contact me. Also please visit my website  www.software-solutions-online.com

3 thoughts on “Index or primary key cannot contain Null value, Access”

Leave a Reply

Your email address will not be published. Required fields are marked *