Others

Normalize a Microsoft Access Cost-Estimate Database with a Junction Table

Kushani NimanthikaKushani Nimanthika Nov 20, 2026 868 views

Question details

The user needs to normalize a Microsoft Access cost-estimate database so each experiment can contain multiple items with their own quantities and prices.

Normalize a Microsoft Access Cost-Estimate Database with a Junction Table
Product
Microsoft Access
Device & OS
not provided
Scenario
An experiment record contains repeated item and quantity fields, such as ItemID1 through ItemID20.
Observed behavior
The repeated-field design can cause calculations to apply the first item's price to other items.
Before you start

Identify the experiment tracking key, the item key, the quantity fields, and the unit-price field in the existing tables. Check that the corresponding key fields use compatible Access data types before creating relationships.

Solution 1Recommended

Create a junction table and calculate costs in a query

Use one row per experiment-item combination to remove repeated fields and calculate each line cost from the matching item price.

1
Create the junction table

In Access, select Create > Table Design. Add TrackingID, ItemID, and NumberItem fields, using key data types compatible with the experiment and item tables. Save the table as ExperimentItems.

2
Set the composite key

In the ExperimentItems table's Design View, select the TrackingID and ItemID rows together, then select Primary Key. This allows each item to appear once per experiment.

3
Create relationships

Open Database Tools > Relationships and add the experiment, item, and ExperimentItems tables. Connect each parent key to its matching junction-table field, and select Enforce Referential Integrity when creating each relationship.

4
Move the existing item data

Use Create > Query Design to create append queries that transfer each populated ItemID and matching quantity pair into TrackingID, ItemID, and NumberItem in ExperimentItems. Check the resulting rows before removing the old repeated fields.

5
Calculate line and estimate costs

Select Create > Query Design and add ExperimentItems and the item table, joined on ItemID. Add TrackingID and the expression LineCost: [ExperimentItems].[NumberItem]*[Items].[UnitPrice], replacing table and field names with your own. To calculate an estimate total, use a totals query that groups by TrackingID and sums the line costs.

Create a junction table and calculate costs in a query
Current prices and repeated items: A query using the item table's unit price reflects its current value. If estimates must retain historical prices, store the agreed unit price on each junction-table row. If the same item must appear on multiple separate lines in one experiment, use a separate line ID as the primary key instead of the TrackingID and ItemID composite key.
Free Microsoft Office alternative

Work with cost-estimate spreadsheets in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with Office files. Open compatible spreadsheets to review cost estimates and migrate common Office documents with ease. It does not replace Microsoft Access for creating database tables or relationships.

Review quantities, unit prices, and cost formulas in WPS SpreadsheetsOpen and edit Microsoft Excel XLSX spreadsheetsWork with Microsoft Word DOCX and PowerPoint PPTX filesUse a familiar interface in a lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why use a junction table for experiments and items?

A junction table represents the many-to-many relationship: an experiment can contain multiple items, and an item can appear in multiple experiments. Each row stores one experiment-item combination and its quantity.

Why might every item use the first item's price?

A query may reference the first item field or its joined price for every calculation. Store each item on its own junction-table row and join that row's ItemID to the item table to retrieve the matching price.

Should I store the total cost in the table?

Normally, calculate line costs and totals in a query to avoid redundant values. If historical estimates must keep the price agreed at the time, store that unit price on the junction-table row and calculate from it.

What if an experiment needs the same item on two separate lines?

A composite primary key of TrackingID and ItemID prevents duplicate combinations. Add a separate line ID as the primary key if the same item must appear more than once in an experiment.