Please Help with Multiple Field Primary Keys

R

ridgerunner

I have two tables in a database that have to use four fields for a unique
identifier and primary key. How do I set up a query to set a relationship
between those four fields together as one? When I add the tables to the
query I see the fields, but I am not having any success properly setting the
relationships.
 
A

Allen Browne

The upper half of the query design window is where the 2 tables appear.

Drag Field1 from Table1, and drop it into Field1 from Table2.
Access displays a join line from one table to the other.

Drag Field2 from Table1, and drop it into Field2 from Table2.
Repeat for the other 3 fields.

Note that is has only set up a JOIN in your query. It does not create
relationships between the tables. To do that, choose Relationships on the
Database Tools tab of the ribbon (Access 2007), or on the Tools menu in
earlier versions.
 
R

ridgerunner

Thank you so much Allen. This is very helpful.

Allen Browne said:
The upper half of the query design window is where the 2 tables appear.

Drag Field1 from Table1, and drop it into Field1 from Table2.
Access displays a join line from one table to the other.

Drag Field2 from Table1, and drop it into Field2 from Table2.
Repeat for the other 3 fields.

Note that is has only set up a JOIN in your query. It does not create
relationships between the tables. To do that, choose Relationships on the
Database Tools tab of the ribbon (Access 2007), or on the Tools menu in
earlier versions.
 

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