Microsoft Office

Microsoft Access How To Link Tables

To link tables in Microsoft Access, use External Data to connect to a table stored in another database, or Database Tools > Relationships to connect related records through matching key fields. These are different tasks: an external link provides access to source data, while a.

Which licences fit your PC setup?

Prices are an AUD snapshot, not a live quote. Confirm variant and total on the listing.

Choose the right way to connect your tables

Start with where the data lives and what you need to do with it:

  • Use an external linked table when you want to work with data held in another database without maintaining a separate copy.
  • Create a relationship when tables contain related information, such as customers and their orders.
  • Use a query join when you want to display matching records from several tables in one result.

You can use these together. For example, an Access database containing forms and reports can link to tables in a separate database, then use queries to present their related records.

Check that you can access the source file and have permission to use its data. Close the source database before starting, and ensure nobody has opened it exclusively.

  1. Open the destination database where you want the linked table to appear.
  2. Go to External Data. Choose New Data Source > From Database > Access. If your ribbon has a separate Access button in the Import & Link group, use that instead.
  3. Browse to the source database file.
  4. Select “Link to the data source by creating a linked table”, then select OK.
  5. Select the required tables in the Link Tables dialogue box and select OK.
  6. Open each linked table from the Navigation Pane and check its records.

The records stay in the source database. Editing them through an editable link changes that source data; importing would create a separate copy. Change field definitions in the source database, rather than through the linked table. Microsoft's Access linking instructions explain this distinction.

Create a relationship between tables

Identify the matching keys

Suppose Customers contains CustomerID as its primary key, and Orders contains CustomerID as a foreign key. A customer can have several orders, so CustomerID is unique in Customers but can repeat in Orders.

The tables can have different columns. Only the fields used for the relationship need compatible types. For a typical AutoNumber primary key, use a Number foreign key with Field Size set to Long Integer. Field names do not have to match.

Add the relationship in Access

  1. Open Database Tools > Relationships.
  2. Add the tables using Add Tables or Show Table, depending on the label available.
  3. Drag the primary key from the parent table onto the corresponding foreign key in the child table.
  4. Check the table and field names in Edit Relationships.
  5. Select Enforce Referential Integrity if the tables and existing data meet its requirements.
  6. Select Create, then save the Relationships layout.

Microsoft's relationship setup guide covers compatible fields and enforcement requirements. For linked Access tables, enable referential integrity in the source database that stores both tables.

Understand relationship types and integrity rules

A one-to-many relationship connects one parent record to multiple child records. A one-to-one relationship requires unique matching values on both sides. For a many-to-many relationship, use a junction table: for example, Enrolments can connect Students and Courses through two one-to-many relationships. The type follows from the keys and indexes, rather than a menu choice.

Referential integrity prevents orphan records, such as an order referencing a nonexistent customer. A relationship alone does not automatically synchronise every field between tables. Cascade Update Related Fields applies to related key values; Cascade Delete Related Records removes dependent records when their parent is deleted. Enable cascading only when that behaviour suits your data.

See Microsoft's guide to table relationships for examples of these structures and rules.

Check the result with a query

Create a query containing Customers and Orders, join their CustomerID fields, and display the customer name and order identifier. One customer appearing on several rows can be correct: each row may represent a different order.

Inspect the join if results are missing or unexpectedly repeated. An inner join returns matching records; a left join can retain customers with no orders. Use identifiers for matching rather than names that may repeat or change. Once the query returns the intended records, use it as the basis for a form or report.

Reconnect a moved source file

  1. Confirm that the source file exists and that you can reach its folder or network location.
  2. Open External Data > Linked Table Manager and select the affected links.
  3. Use Refresh to check the connection, or Relink to supply the correct source location. Available controls vary by Access version.
  4. Reopen the table and the queries that depend on it.

Microsoft's Linked Table Manager guidance describes the repair options. Removing a linked table removes the connection from your database; deleting records through an editable link affects the source records.

Check data and setup separately

If a relationship cannot enforce integrity, look for duplicate parent keys, child keys without a matching parent, or incompatible field types. If a query gives incorrect results, check its join fields and criteria before recreating external links.

If Office activation prevents you from using Access, address that separately with the guide to activating Microsoft Office using CMD. If troubleshooting requires a licence key, consult finding an Office product key using Command Prompt. More application guidance is available in the Microsoft Office guides.

Next, test one linked table or one pair of related tables in a copy of your database, then run a query whose expected records you can check by hand.

Other editions for separate workloads

Other editions for separate workloads; prices in AUD, confirm the total on the listing.

How to check this worked

  1. Open Settings, System, Activation and confirm the edition shown.
  2. Enter the key and run activation; expect a green tick within a minute.
  3. Reboot and re-check activation survives the restart.

FAQ

What else should you know before buying?

What do I need before starting?
Read the requirements and confirm the edition first; the steps assume the machine is compatible.
How do I know the licence is genuine?
Activate on Microsoft's servers and check Settings, System, Activation. A working activation is the test.
Is this a subscription?
Keys sold here are one-time lifetime licences. Microsoft 365 plans are billed by Microsoft instead.
What if the key fails?
Email hi@ms.codes with the order number and a screenshot. Replacement or refund applies within 30 days.

Check who prepared and reviewed this guide

Written by
MS.Codes editorial
Reviewed by
Support team

Last verified: (source review; see test status above).

Recent Post