Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / October 2005

Tip: Looking for answers? Try searching our database.

Setting more than one primary key field?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Randy - 06 Oct 2005 13:43 GMT
When I set up a table I set the autonumber as a primary key.  Now I
need to add three other fields as primary key fields.

Can this be done?  How?
Rick Brandt - 06 Oct 2005 13:56 GMT
> When I set up a table I set the autonumber as a primary key.  Now I
> need to add three other fields as primary key fields.
>
> Can this be done?  How?

A table can have exactly one primary key.  That one key however can consist
of anywhere from one to (ten?) fields.  One can also define unique indexes
in a table again consisting of one to ten fields that can exist alongside
the Primary Key.  This latter is what you need.

Creating multi-column indexes that are not the PK is not one of the more
obvious things to do in Access.  You need to open the table in design view
and then go to "View Indexes" in the menu.  Then you enter your index like
this...

IndexName    Field1Name
                     Field2Name
                     Field3Name

(At the bottom) Unique = Yes.

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

ghillie5150 - 06 Oct 2005 20:17 GMT
Look up "composite primary key" on the net. Most of the time you have to
create this type of primary key because the table is an associative entity
remedying a many-to-many relationship.

> When I set up a table I set the autonumber as a primary key.  Now I
> need to add three other fields as primary key fields.
>
> Can this be done?  How?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.