SubForm?

tlindeman

Active Member
Joined
Jun 29, 2005
Messages
313
I am building a recipe database. I would like to create a form where the user enters an ingedient, so I setup a table with ingredient 1 through Ingredient 10. I only want the choice for ingredient 2afteringredient 1 is entered,and ingredient 3 after ingredient 2 is entered. Etc. How do I do that.

Thank YOu
TOny
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
First thing is to fix your table structure. You should NOT have repeating fields (ingredient1, ingredient2, etc.). Those should be ROWS in a table not columns. Your current structure is not normalized and if properly normalized you should be able to handle ANY number of ingredients. So typically the table structure would be something like:

tblIngredients
IngredientID - Autonumber (PK)
IngredientName - Text
IngredientTypeID - Long Integer (FK from IngredientTypes table)

tblIngredientTypes
IngredientTypeID - Autonumber (PK)
IngredientType - Text

tblRecipeHeader
RecipeHeaderID - Autonumber (PK)
RecipeTitle - Text
CookingTypeID - Long Integer (FK from CookingTypes table)
CookingTime - Long Integer (for storing cooking time in minutes)
CookingTemp - Integer (for storing cooking temperature)

tblCookingTypes
CookingTypeID - Autonumber (PK)
CookingType - Text ' things like Wet, Baked, Roasted, Raw, Broiled, etc.

tblRecipeDetails
RecipeDetailID - Autonumber (PK)
RecipeID - Long Integer (FK)
IngredientID - Long Integer (FK)
Quantity - Integer
UnitOfMeasureID - Long Integer (FK from tblUOM)

tblUOM
UnitOfMeasureID - Autonumber (PK)
UnitOfMeasure - Text (like Tablespoons, Teaspoons, Cups, etc.)
UnitOfMeasureAbbrev - Text (like tbsp, tsp, cup, etc.)

So the recipe details is where you would store all of the ingredients and it would not be limited to 10.
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top