Others

How to Design and Update Junction Tables in Microsoft Access

Natalie TaylorNatalie Taylor Nov 25, 2026 868 views

Question details

Learn how to design a junction table for a many-to-many relationship and add or update its records.

How to Design and Update Junction Tables in Microsoft Access
Product
Microsoft Access
Device & OS
not provided
Scenario
Two tables need to be connected through a junction table, with relationships entered through forms, queries, or code.
Observed behavior
The junction table stores each relationship as a record containing foreign keys from both source tables and, optionally, attributes of that relationship.
Before you start

Identify the primary key in each source table and decide whether each pair of records should appear only once in the junction table. Check that the junction table's foreign-key data types match the referenced keys; an AutoNumber key typically uses a Number field with the Long Integer field size.

Solution 1Recommended

Create a Junction Table and Update It Through a Subform

Use this approach when users need to create relationships and enter relationship details through an Access form.

A junction table contains a foreign key for each source table. It can also store attributes of the relationship, such as quantity or the unit price recorded at the time of an order.

Adding records to the source tables does not automatically create a junction-table record. The relationship must be entered separately.

1
Create the junction table

Select Create > Table Design. Add a foreign-key field for each source table and any relationship fields you need. Set the two foreign-key fields as a composite primary key, or use a separate primary key and create a unique composite index on the pair.

2
Define the relationships

Open Database Tools > Relationships, add the three tables, and connect each source table's primary key to its corresponding junction-table field. Select Enforce Referential Integrity when creating each relationship, then save the layout.

3
Build a bound subform

Create a form whose Record Source is the junction table. Add it as a subform to a form bound to one source table, and set the subform control's Link Master Fields and Link Child Fields properties to the matching parent key and junction-table foreign key.

4
Add a combo box

In the subform's Design View, add a combo box that lists records from the other source table. Set its Control Source to the corresponding junction-table foreign-key field and configure its row source to include the key and a recognizable display value.

5
Enter a relationship

Open the parent form in Form View, add a row in the subform, select the related record from the combo box, and enter any relationship attributes. Save the record to insert the junction-table row.

Create a Junction Table and Update It Through a Subform
Adding a missing choice: Use the combo box's NotInList event to handle a value that is not in the list, or set its List Items Edit Form property to a form for editing the referenced table. After adding a source record, refresh or requery the combo box and select it to create the junction-table relationship.
Free Microsoft Office alternative

Work With Office Files Alongside Your Access Database

WPS Office is a free, lightweight alternative for everyday document, spreadsheet, and presentation work. Its familiar interface and Microsoft Office format compatibility make it easy to move existing files into your workflow. It does not replace Microsoft Access or manage Access junction tables.

Review tabular data in WPS Spreadsheets alongside your Access workflowCompatible with Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXFamiliar editing tools make it easier to move from Microsoft OfficeFree, lightweight tools for common office tasks
QA img-9

Frequently Asked Questions

Does adding records to both source tables automatically create a relationship?

No. Add a record containing both foreign keys to the junction table through a bound form, an append query, or VBA code.

How do I prevent duplicate relationships in a junction table?

In Table Design, make the two foreign-key fields a composite primary key, or create a unique composite index on the pair. A separate primary key alone does not prevent duplicate pairs.

Which table should the subform be bound to?

Set the subform's Record Source to the junction table. Use a combo box whose Control Source is the junction table's foreign-key field to select a record from the other source table.

Can a junction table store more than two foreign keys?

Yes. It can also contain fields describing the relationship, such as quantity or historical unit price. Add those fields in Table Design and include them on the bound subform if users need to edit them.

What if a combo box does not contain the record I need?

Add the record to its referenced table using an appropriate form. You can configure the combo box's NotInList event or List Items Edit Form property to help users add missing choices, then requery the combo box and select the new record.