How do you assign two primary keys?

G

Guest

Hi, I need to assign two primary keys in a table. I pulled up the help file
and it says I can but I can’t find how to do it. When I click on a row to
make it the primary key the other cancels the other one I have set. I am
using Access 2002. I am trying to set up a customer order database similar to
the North wind sample.

Thank you,
James
 
R

RoyVidar

James said:
Hi, I need to assign two primary keys in a table. I pulled up the
help file and it says I can but I can’t find how to do it. When I
click on a row to make it the primary key the other cancels the
other one I have set. I am using Access 2002. I am trying to set up
a customer order database similar to the North wind sample.

Thank you,
James

There's only one primary key, but it can contain more than one field.

Select the fields you wish to be part of the compound primary key (hold
ctrl while clicking the grey "field selectors"), then hit the primary
key button on the toolbar (or right click to the right of the grey
"field selectors", and select primary key)
 
R

Rick Brandt

James said:
Hi, I need to assign two primary keys in a table. I pulled up the
help file and it says I can but I can't find how to do it. When I
click on a row to make it the primary key the other cancels the other
one I have set. I am using Access 2002. I am trying to set up a
customer order database similar to the North wind sample.

Thank you,
James

You cannot assign two PK to a single table, but you can have ONE PK that is made
up of two or more fields. Just hold the control key while selecting the fields
in design view of the table and then press the [key] button in the toolbar.
 

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