Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
When I am adding records to my database, occasionally an error message pops up that doesn't make much sense. Index or primary key cannot contain a Null value. And when that happens, no matter what you do, it won't let you out. So let's recreate that error. I am in my Customers table and I will make a new blank record, but Tab over your primary key or ID field so that it's left blank. I will fill in a few fields of information. Now, click off the record and the error message pops up. When I click OK and I try and get out again, it still won't let me.
The only thing you can do to get out is to press the Escape key in the upper left corner of your keyboard, but that will erase all the information that you entered. The error is simple but not obvious. As we created the record, we left the primary key filed empty. You didn't enter the ID that distinguishes this record from all the other records in the table. So let's try again. Start with your ID or primary key field and then enter in the rest of the data.
When you move to the next record, this time everything will be fine. I see beginners make this cannot contain a Null value error all the time, and it leaves them flustered and frustrated because the error message itself doesn't help you identify the underlying problem. But once you remember that your table's primary key field is required, it all makes sense. If you are not familiar with primary keys, please see your Access 2010 Essential Training for detailed information.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 64863 Viewers
80 Video lessons · 124401 Viewers
52 Video lessons · 60325 Viewers
59 Video lessons · 46149 Viewers