A one-to-many relationship in Microsoft Access links a parent table to a child table so that one record in the parent can match many records in the child. You create it by opening the Database Tools tab, clicking Relationships, adding both tables, and dragging the primary key from the parent onto the matching foreign key field in the child. Before you start, the parent table must have a primary key, and the child table must contain a field of the same data type to hold the foreign key. This guide walks through the exact steps, the mistakes that break the link, and how to fix them.
What You'll Need
- Microsoft Access desktop application (Microsoft 365 or a recent perpetual version). The Relationships window is not available in Access for the web.
- Two tables in the same database: a parent table (for example, Customers) and a child table (for example, Orders).
- A primary key defined on the parent table, such as an AutoNumber CustomerID.
- A foreign key field in the child table with the same data type as the parent key (for example, a Number field named CustomerID in Orders).
Step-by-Step
- Close both tables. You cannot edit relationships while a table is open in Design view or Datasheet view. Save any changes and close the tabs.
- Open the Relationships window. Go to the Database Tools tab and click Relationships. If the window is empty, the Show Table dialog appears; if not, right-click the background and choose Show Table.
- Add both tables. In the Show Table dialog, select the parent table, click Add, select the child table, click Add, then click Close. Drag the table boxes so you can see both.
- Check the parent primary key. In the parent table box, the primary key field appears in bold. If no field is bold, close the window, open the parent table in Design view, select the key field, and click Primary Key on the Design tab. Save and reopen Relationships.
- Drag the primary key onto the foreign key. Click the bold primary key in the parent table, hold the mouse button, and drop it onto the matching field in the child table. The Edit Relationships dialog opens.
- Confirm the field mapping. The dialog should show the parent key on the left and the child field on the right. If the wrong field appears, cancel and drag again onto the correct field.
- Set referential integrity. Tick Enforce Referential Integrity. This prevents orphan child records and keeps the link consistent. Optionally tick Cascade Update Related Fields so changing a parent key updates the child automatically, and Cascade Delete Related Records only if you want deleting a parent to delete its children. Cascade Delete permanently removes data, so enable it deliberately.
- Click Create. Access draws a line between the tables with a 1 at the parent end and an infinity symbol at the child end. That is your one-to-many relationship.
- Save the layout. Click Save on the Quick Access Toolbar or press Ctrl+S, then close the Relationships window.
- Test it. Open the child table and add a record with a foreign key value that does not exist in the parent. With referential integrity enforced, Access rejects it. Then open the parent table and use the expand button (the plus sign) next to a record to see its related child records.
Menu labels can differ slightly by Access version, device, and region, but the Database Tools > Relationships path has been stable for years.
Common Mistakes
- Mismatched data types. An AutoNumber parent key must match a Number child field with Field Size set to Long Integer. Text-to-Number links fail.
- No primary key on the parent. Access cannot create the relationship without a unique key to anchor the one side.
- Dragging onto the wrong field. Always drop the parent key onto the child's foreign key, not onto another field such as the child's own primary key.
- Forgetting referential integrity. Without it, Access allows orphan records and the relationship is only a visual line.
- Enabling Cascade Delete casually. Deleting one parent record can wipe many child records with no easy undo.
- Editing tables while the Relationships window is open. Close the window before changing table design, then reopen it.
Tips
- Name the foreign key exactly like the parent key (CustomerID in both tables) so the link is obvious to anyone maintaining the database.
- Use AutoNumber for the parent primary key and Long Integer for the child foreign key; this is the most reliable pairing.
- Create a lookup field in the child table that pulls from the parent table so users pick a valid parent instead of typing a number.
- Build a query joining both tables to verify the relationship returns the expected rows before building forms and reports.
- Keep the Relationships window tidy; drag tables into a logical layout and save it so the schema is readable later.
Troubleshooting
The Create button is greyed out. The two selected fields are not compatible. Check that the parent field is the primary key and that both fields share the same data type and Field Size.
Access says it cannot create the relationship because of duplicate or null values. The child table already contains foreign key values that do not exist in the parent, or the parent key has duplicates. Clean the data first: delete or correct orphan rows, remove duplicates, and make sure the parent key is unique.
The line appears but no 1 and infinity symbols show. Referential integrity is off. Double-click the line, tick Enforce Referential Integrity, and click OK.
You cannot delete a parent record. Referential integrity is blocking the delete because child records exist. Delete or reassign the child records first, or enable Cascade Delete if that is truly what you want.
The relationship disappeared after reopening the database. The layout was not saved, or the relationship was created in a different database file. Recreate it and press Ctrl+S before closing the Relationships window.
You need to remove a relationship. Open the Relationships window, click the line, press Delete, and confirm. This removes the link but does not delete table data.
Frequently Asked Questions
Can I create a one-to-many relationship in Access for the web?
No. The Relationships window is a desktop Access feature. Access for the web works with web apps and does not expose the same relationship designer.
Do I need referential integrity?
It is strongly recommended. Without it, Access will not stop you from entering child records that point to a parent that does not exist, which leads to broken queries and reports.
What is the difference between one-to-many and many-to-many in Access?
A one-to-many link uses a single foreign key in the child table. A many-to-many link requires a third junction table that holds foreign keys to both parent tables.
Can I change the relationship after creating it?
Yes. Double-click the relationship line in the Relationships window to reopen the Edit Relationships dialog and change the options, or delete the line and recreate it.
Why does Access show a 1 and an infinity symbol?
The 1 marks the parent side, where each key value is unique. The infinity symbol marks the child side, where the same foreign key value can appear on many records.
Does deleting a relationship delete the data?
No. Deleting the relationship line only removes the link and its enforcement rules. The table records remain until you delete them separately.