How to create Composite keys in an ACCESS table

  • Thread starter Thread starter Thelma McCoy
  • Start date Start date
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?
 
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.
 
Thank you. That worked. The instruction book I was using
didn't mention the CTRL Key.
 
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


'
 
Back
Top