Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

queries

ResolvedVersion 2003

Fatou has attended:
Access Intermediate course

Queries

Creating relationships

RE: Queries

Hi Fatou,

Thank you for your question.

Do you mean how do you create relationships?

If so, if we take the example of a two table database which has a Customer table and Orders table.

Each table requires a Primary key which uniquely identifies each new Customer and each new Order. So the two primary keys would be Customer_ID and Orders_ID.

However in the Orders table you need a Foreign key to link the two tables together. So underneath the Primary key in the Orders table you need to insert a new field called Customer_ID (the name of the Primary key in the Customer table) which is your foreign key.

Make sure the Data Type for Customer_ID field in the Customer table is Autonumber and make sure that the Foreign key is set as a Number Data Type and the field size is Long Integer.

Then go to Tools and Relationships and drag the Primary key from the Customer Table on top of the foreign key in the Orders table and enforce Referential Integrity.

I hope this answers your question.

Regards

Simon

Access tip:

Design View in Relationship window

Your in the Relationship window and changes are required to be made to a Table's design.

Rather than exiting the Relationship window, if you perform a right-mouse click on the table, it opens that table up in Design view

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.