Access 2000 Primary Keys

C

Chester1

I am trying to concatenate 2 primary keys on one table

I have 2 tables one called
Courses - Course information only the fileds are
DeptCode - Primary Key
CourseNo -Primary Key
Title
Credits
Activity

Section - Section Information only
DeptCode - Primary Key
CourseNo -Primary Key
Section
Session
CatalogueNo
Term

DeptCode could be COMM but there could be many CourseNo belonging to this
dept ie 290, 291, 292.

So what I am trying to do is when I create the relationship with
refferencial integgrity it will check both the DeptCode and CourseNo as a
joint primary key.

Sorry if this is a bit vague but hope you can help.

Regards Clair
 
D

Douglas J Steele

There's no need to concatenate the values into a single field: you can have
up to 10 separate fields in an index.

With your table open in Design view, select both fields, then click on the
Key icon to make the combination of the two the primary key. Once the
primary keys have been properly set in the two tables, creating the
relationship between them and enforcing referential integrity will use both
fields.

However, I have to question your tables. Do you really need two separate
tables? When two tables have the same primary keys, you can only set them up
as a 1-to-1 relationship, and those aren't all that common.
 

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