when using two primary keys in a Access 2003 table I get an error.

G

Guest

When trying to use two primary keys in a table, when I save I get an error
message that says "index and primary key cannot contain null value." What do
I need to change to be able to save this table with two primary keys?
 
J

John W. Vinson

When trying to use two primary keys in a table, when I save I get an error
message that says "index and primary key cannot contain null value." What do
I need to change to be able to save this table with two primary keys?

First off, a table can have only ONE primary key. It can consist of two (or
for that matter, ten) fields - but it's one Primary Key.

The error message means exactly what it says: a primary key cannot contain a
NULL value. Somewhere in your table, the field that you're trying to include
in your primary key is empty in some record or records. You must fill every
single record with data in both fields which will comprise the primary key.

You can run a query with a criterion

IS NULL

on the field to identify the problem records.

John W. Vinson [MVP]
 
G

Guest

hii i guess the fiels u have applied primary keys shouldn't be null or
one null while the other have the data etc
so both may be null or may have some data then try .......
 

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