Error Message

N

newby

When trying to create a query, I keep getting the code below

Index or primary key cannot contain a Null value.


I'm very new at Access and don't know where to start to fix the problem.
 
J

John W. Vinson

When trying to create a query, I keep getting the code below

Index or primary key cannot contain a Null value.


I'm very new at Access and don't know where to start to fix the problem.

Creating a query shouldn't give this error; running an action query might, if
it attempts to add a record to a table without putting data into the Primary
Key field of your table.

More info please! What table or tables is the query based upon? Could you open
the query in SQL view and post it here? What action are you taking which
triggers the error message?
 
G

golfinray

That means you probably don't have a field set in your table as the primary
key. The key should be something like an I.D. number, social security number
or the like. Then, there can't be any null values in your primary key. Every
row has to have data. You can just add a new field to the table and make it
autonumber and then set it as the primary key.
 
J

John W. Vinson

That means you probably don't have a field set in your table as the primary
key.

Ummmm... Ray, if there is no Primary Key then Access will certainly NOT give
you an error message that you're attempting to set the primary key to NULL.
 

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