Design a Microsoft Access Recipe Database with Recipes as Ingredients
Question details
Create an Access recipe database in which a completed recipe can be selected as an ingredient in another recipe.

- 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.
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.
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.
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.
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.
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.
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.
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.
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.

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.

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.




