queries

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

Forum home » Delegate support and help forum » Microsoft Access Training and help » Queries

Queries

resolvedResolved · Low Priority · Version 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:

Modal forms

If you have created a form / switchboard and dont want people to get away from using the switchboard, you can change the form properites for Modal to On.

View all Access hints and tips


Server loaded in 0.08 secs.