"Index or primary key cannot contain a Null value" error message

G

Guest

Hi,

I am very new to & unfamiliar with Access. I am working with an already
existing database at my office.

Yesterday, my coworker exported a table into Excel to fix data in one
column. When she imported the table back to Access, we now get the error
message "Index or primary key cannot contain a Null value" message when we
try to input new data. Only one field is designated as the primary key and
it has data in it. And she erased all the indexes.

Last time she erased all the primary keys and reinputted them and this
solved the problem. However, this time that didn't work.

Sorry, this information might not be enough, but can anyone advise on what
the problem may be or how to fix it? My coworker is much more skilled with
Access but she hasn't been able to fix the problem.

Any help will be greatly appreciated!
 
G

Guest

Why are you exporting to Excel to fix data and then re-importing? Why not fix
the data in Access?
Second, the message means exactly what it says, you have null values in a
key or index. The record wont have been added to the Access table, so you'll
have to look in Excel at every column defined in Access as 'indexed'.

Dorian
 
G

Guest

We have already removed indexes from all the other fields but it didn't work.

Is there any kind of problem that occurs when exporting & importing from
Excel that can easily be fixed? Sorry it must be hard to provide all
necessary info & our database seems rather complicated. We fixed the
relationships too, but it didn't seem to work.
 
G

Guest

Try importing in to a structural copy of the table without a primary key or
any indexes. Them sort on the field that is used for the primary key and see
which record has the null.
 
G

Guest

I don't know if this means anything, but our primary key for this table is an
autonumber. We can't see where the information is missing for the primary
key & we've removed the indexes...
 
J

Jeff Boyce

You may believe you've removed the indexing, but you may have hidden
indexes. Any chance any of the tables includes a "lookup" data type field?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

If you took it out to Excel and bringing it back again you are probably
bringing back the autonumber and possibly an additional Excel row as records
and therefore have nulls in the autonumber field.
As I said bring the data in a table with primary key and see what is being
imported.
 
G

Guest

Thanks for all the help. Someone else fixed the problem for us. I'm not
sure how but if I find out more information about what was the problem & how
to fix it, I will post more info on here. I just wanted to say thank you
first!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top