Error Message

  • Thread starter Thread starter newby
  • Start date Start date
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.
 
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?
 
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.
 
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.
 
Back
Top