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

J

Jay

Sorry, friend; it is not possible. As the name implies,
the primary key is primary, so there can be only one.

Cheers,

Jay
 
S

Steve Schapel

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
 
J

John Vinson

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).
 
T

TC

As the others have said: no.

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

TC
 
A

Adrian Jansen

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
 
T

Tim Ferguson

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
 

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