Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use referencial intergrity with multiple primary keys? 1

Status
Not open for further replies.

dontay

Programmer
Jan 22, 2003
49
US
Hi,
I have a table that has a dual primary key, and I want to build a relationship with another table and use referencial integrity, but the relationship builder in access will not let me use referencial integrity. Probably because I don't know how to link the two tables properly.
Any ideas?
 
No guarantees, but try this...

Select fields 1 and 2 in one table. CTRL-Left-Click.

Drag the fields from the first table to the second table.

The relations window opends. Select first fields for target table, and then select appropriate field name.

Repeat for the second field.

Check off enforce referential integrity.

You have to wonder why many simpilier databases use numbers for keys.

Richard
 
Hi

You say 'dual' primary keys

do you mean the table(s) have two keys both of which are unique,

or

do you mean a primary key composed of two columns, sometimes called a compound primary key, classic example of this is (say) Purchase Order Number / Item Number as the key of a Purchase Order Line Item

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top