izen
Registered User.
- Local time
- Today, 19:07
- Joined
- Apr 2, 2009
- Messages
- 50
Hi there!
I have a problem about Recipe database. My database has 3 main tables
<Recipe table >
RecipeID (PK)
RecipeName
FoodCategoryID
PortionYield
PercentFoodCost
Instructions
Source
Picture
<Ingredient table >
IngredientID (PK)
IngredientName
IngredientCategoryID
Quantity
Unit
Cost
<RecipeIngredient Table>
RecipeIngredientID (PK)
RecipeID
IngredientID (Users choose the ingredients from the combo box which receives the ingredients from ingredient table)+++
Quantity
Unit
My problem is some of recipes can be ingredient in other recipe as well. For example, Napoleon sauce can be an ingredient in other recipes such as pizza topping, some pasta sauces, some stews.
In recipe form I have subform of RecipeIngredient table that users can add Ingredients that belongs in each Recipe
For example <Recipe table>
ReciepID 16
Reciep Name Napoleon Sauce
FoodCategory Sauces
PortionYield 20 Lt
PercentFoodCost 25%
Instructions bla bla bla
Source
Picture
subform <recipeIngredient table>
RecipeIngredientID 1
RecipeID 16
IngredientID 20 (tomoto)
Quantity 10
Unit kg
RecipeIngredientID 2
RecipeID 16
IngredientID 50 (basil)
Quantity 2
Unit each
RecipeIngredientID 3
RecipeID 16
IngredientID 100 (honey)
Quantity 500
Unit g
RecipeIngredientID 4
RecipeID 16
IngredientID 29 (tomato paste)
Quantity 800
Unit g
======================================
RecipeID 17
RecipeName Red wine beef stew
FoodCategory Main
PortionYield 10 lt
PercentFoodCost 25%
Instructions .....
Source .....
Picture ......
================================
subform RecipeIngredient table
RecipeIngredientID 5
RecipeID 17
IngredientID 30 >>>> (Chuck Beef)
Quantity 5
Unit kg
RecipeIngredientID 6
RecipeID 17
IngredientID Napoleon sauce***
Quantity 2
Unit lt
RecipeIngredientID 7
RecipeID 17
IngredientID 29 >>>> (tomato paste)
Quantity 400
Unit g
RecipeIngredientID 8
RecipeID 17
IngredientID 24 >>>> (Red wine)
Quantity 500
Unit ml
RecipeIngredientID 9
RecipeID 17
IngredientID 36 >>>> (beef stock)
Quantity 2
Unit lt
============================================
++++If ingredients in combo box comes from ingredient table We cannot choose recipe that can be ingredient this case is Napolean sauce wont show up in combo box
****the problem is Napoloen sause should have RecipeId or IngredientID as a reference
and could u pls tell me that kind of problem that I am dealing with how to deal with pls?
Pls check the attrached files
thank you for your time
I have a problem about Recipe database. My database has 3 main tables
<Recipe table >
RecipeID (PK)
RecipeName
FoodCategoryID
PortionYield
PercentFoodCost
Instructions
Source
Picture
<Ingredient table >
IngredientID (PK)
IngredientName
IngredientCategoryID
Quantity
Unit
Cost
<RecipeIngredient Table>
RecipeIngredientID (PK)
RecipeID
IngredientID (Users choose the ingredients from the combo box which receives the ingredients from ingredient table)+++
Quantity
Unit
My problem is some of recipes can be ingredient in other recipe as well. For example, Napoleon sauce can be an ingredient in other recipes such as pizza topping, some pasta sauces, some stews.
In recipe form I have subform of RecipeIngredient table that users can add Ingredients that belongs in each Recipe
For example <Recipe table>
ReciepID 16
Reciep Name Napoleon Sauce
FoodCategory Sauces
PortionYield 20 Lt
PercentFoodCost 25%
Instructions bla bla bla
Source
Picture
subform <recipeIngredient table>
RecipeIngredientID 1
RecipeID 16
IngredientID 20 (tomoto)
Quantity 10
Unit kg
RecipeIngredientID 2
RecipeID 16
IngredientID 50 (basil)
Quantity 2
Unit each
RecipeIngredientID 3
RecipeID 16
IngredientID 100 (honey)
Quantity 500
Unit g
RecipeIngredientID 4
RecipeID 16
IngredientID 29 (tomato paste)
Quantity 800
Unit g
======================================
RecipeID 17
RecipeName Red wine beef stew
FoodCategory Main
PortionYield 10 lt
PercentFoodCost 25%
Instructions .....
Source .....
Picture ......
================================
subform RecipeIngredient table
RecipeIngredientID 5
RecipeID 17
IngredientID 30 >>>> (Chuck Beef)
Quantity 5
Unit kg
RecipeIngredientID 6
RecipeID 17
IngredientID Napoleon sauce***
Quantity 2
Unit lt
RecipeIngredientID 7
RecipeID 17
IngredientID 29 >>>> (tomato paste)
Quantity 400
Unit g
RecipeIngredientID 8
RecipeID 17
IngredientID 24 >>>> (Red wine)
Quantity 500
Unit ml
RecipeIngredientID 9
RecipeID 17
IngredientID 36 >>>> (beef stock)
Quantity 2
Unit lt
============================================
++++If ingredients in combo box comes from ingredient table We cannot choose recipe that can be ingredient this case is Napolean sauce wont show up in combo box
****the problem is Napoloen sause should have RecipeId or IngredientID as a reference
and could u pls tell me that kind of problem that I am dealing with how to deal with pls?
Pls check the attrached files
thank you for your time
Attachments
Last edited: