Can I make more than one primary key in a table?

  • Thread starter Thread starter Mike
  • Start date Start date
Sorry, friend; it is not possible. As the name implies,
the primary key is primary, so there can be only one.

Cheers,

Jay
 
Mike,

No, you can't have more than one primary key in a table.

It is not clear what, or more importantly why, you are asking. If you
mean you want more than one field where duplicate values are not
permitted, then set the Indexed property of such a field to 'Yes (No
Duplicates)'... this does not make this field a primary key though.
If you mean you want the primary key to be comprised of a combination
of more than one field, you can do this too... Hold down the Ctrl key
and select both fields in table design with the mouse, and then click
the primary key toolbar icon.

- Steve Schapel, Microsoft Access MVP
 
How Do I do this if it is possible.

No; <Highlander> There can only be one! </Highlander>

HOWEVER - a Primary Key can consist of up to TEN fields. Just
ctrl-click the fields which jointly constitute the primary key in
table design view and click the Key icon. You can also create a unique
Index on any field (or any combination of up to ten fields).
 
As the others have said: no.

Why do you want to? What is the structure of the table in question?

TC
 
Be careful, as others have found out, owning a Ring is not necessarily a
good thing :-)

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Be careful, as others have found out, owning a Ring is not necessarily a
good thing :-)

Is this a thread merge back with the discussion on the
object.SetHiddenAttribute method?

Tim F
 
Back
Top