How to create Composite keys in an ACCESS table

T

Thelma McCoy

I have created tables for an Access database on my pc at
home. It is not connected to an SQL server. One table in
my database needs a composite key consisting of three
fields. It appears that my version of Access 2002 allows
only a single field to be a key. Is this a limitation of
the Home Edition Windows XP Access 2002 product?
 
J

Joan Wild

Thelma McCoy said:
I have created tables for an Access database on my pc at
home. It is not connected to an SQL server. One table in
my database needs a composite key consisting of three
fields. It appears that my version of Access 2002 allows
only a single field to be a key. Is this a limitation of
the Home Edition Windows XP Access 2002 product?

What makes you think that? Are you getting an error when you attempt to
create it?

In design view, you can select the three fields (hold the Ctrl key down
while you select the fields) and then hit the Primary Key button on the
toolbar.
 
T

Thelma McCoy

Thank you. That worked. The instruction book I was using
didn't mention the CTRL Key.
 
J

John Vinson

I have created tables for an Access database on my pc at
home. It is not connected to an SQL server. One table in
my database needs a composite key consisting of three
fields. It appears that my version of Access 2002 allows
only a single field to be a key. Is this a limitation of
the Home Edition Windows XP Access 2002 product?

No, it is not. You can create a composite key on up to TEN fields!

To do so, open the Table in design view. To create a multifield
Primary Key, ctrl-click each field that will be part of the key (so
that they are all highlighted); then click the key icon.

If you want a multifield Index, click the indexes icon (looks like
lightning hitting a datasheet); type a name for the index in the left
column and select up to ten fields in that row and succeeding rows in
the right column, e.g.

idxNameAddr LastName
FirstName
Suffix
Address1
PostCode


'
 

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