Others

Design a Microsoft Access Recipe Database with Recipes as Ingredients

Ayan MasoodAyan Masood Nov 18, 2026 869 views

Question details

Create an Access recipe database in which a completed recipe can be selected as an ingredient in another recipe.

Design a Microsoft Access Recipe Database with Recipes as Ingredients
Product
Microsoft Access
Device & OS
not provided
Scenario
A recipe form has an ingredients subform linked to a products table, and the user wants prepared recipes to appear alongside basic products.
Observed behavior
The desired design lets recipe details reference either a basic product or a prepared recipe through a shared ingredient record.
Before you start

Review the existing Products table and recipe form to identify their primary keys and links. Decide which existing products should represent prepared recipes and choose a quantity unit for each recipe detail.

Solution 1Recommended

Use a shared products table for ingredients and recipes

Use this relational design when a recipe must be available in the same ingredient list as basic products.

Each selectable item has one record in Products. A prepared recipe also has a linked record in Recipes, while RecipeDetails stores the items used by each recipe.

This structure permits nested recipes, but relationships alone do not prevent a recipe from including itself or creating an indirect cycle. Add validation before relying on recursive calculations.

1
Create the shared item table

Open Products in Design View. Use an AutoNumber IngredientID as the primary key, and add fields such as ProductName and ItemType to distinguish basic products from prepared recipes.

2
Create recipe headers

Use Create > Table Design to create Recipes with an AutoNumber RecipeID primary key and an IngredientID Number field with Field Size set to Long Integer. Set Indexed to Yes (No Duplicates) for IngredientID so each product can have at most one recipe header.

3
Create recipe details

Create a RecipeDetails table with a primary key, Long Integer RecipeID and IngredientID fields, and fields for Quantity and Unit. Each detail row represents one ingredient used by a recipe.

4
Define the relationships

Open Database Tools > Relationships and add all three tables. Link Products.IngredientID to Recipes.IngredientID, Recipes.RecipeID to RecipeDetails.RecipeID, and Products.IngredientID to RecipeDetails.IngredientID. Enable referential integrity for each relationship.

5
Build the entry forms

Create a form bound to Products, with a Recipes subform linked by IngredientID. Within the Recipes subform, add a RecipeDetails subform linked by RecipeID. In the details subform, use a combo box bound to IngredientID with Products as its row source; display ProductName while storing IngredientID.

6
Enter and reuse a recipe

In Form View, add a Products record for the prepared recipe and mark its ItemType as a recipe. Add its linked Recipes record, then enter ingredients in the details subform. Requery the ingredient combo box after adding a product so the new recipe appears in its list.

Use a shared products table for ingredients and recipes
Prevent circular recipes: Before saving a recipe detail, use validation code to reject the current recipe and any item that would create an indirect cycle. A simple combo-box filter can exclude the current recipe, but it does not catch longer cycles.
Free Microsoft Office alternative

Track Recipe Ingredients in WPS Spreadsheets

WPS Office is a free, lightweight alternative for working with Office documents in a familiar interface. Open existing spreadsheets to track recipe ingredients and migrate tabular data easily. WPS does not replace Access relationships or fix an Access database design.

List recipes, ingredients, quantities, and units in a spreadsheet.Open and edit Microsoft Excel XLSX files.Use a familiar spreadsheet interface for tabular data.Work with a free, lightweight Office alternative.
microsoft office alternative - wps office

Frequently Asked Questions

Why should recipes and basic products share an ingredient ID?

A shared Products record gives the RecipeDetails.IngredientID field one table to reference. The ingredient combo box can then list both basic products and prepared recipes.

How does a new recipe appear in the ingredient list?

First create a Products record for the recipe, then create its linked Recipes record. Requery the ingredient combo box so it reloads the Products records.

Can Access prevent a recipe from including itself?

You can filter the current recipe out of the ingredient combo box, but indirect cycles require additional validation code that checks the chain of recipe ingredients before a detail is saved.

Why are recipe headers and recipe details separate?

The Recipes table stores one header per prepared recipe, while RecipeDetails stores multiple ingredient rows linked by RecipeID. This allows each recipe to contain several ingredients without repeating header data.