C
chadallen
Guest
I am creating a database for a baking business. I have already setup the tables and most of the forms but I am running into troubles when calculating the costs. What I want it to do is when we enter in a recipe for it to give us the total cost to make that recipe. Here is my table layout:
tblMeasure
MeasureID
MeasureName
tblIngredients
IngredientID
IngredientName
Amount
MeasureID
IngredientCost
tblRecipeIngredients
RecipeIngredientsID
RecipeID
IngredientID
IngredientAmount
MeasureID
tblRecipe
RecipeID
RecipeName
RecipeInstructions
Time to Prepare
Number of Servings
I have three forms for this so far. One is a simple form to enter in Measurement names (tablespoon, teaspoon, cup, etc.) Another is to enter in the Ingredients and their cost per measurement. The third is the main form, the recipe form. Here I have it setup to enter the recipe name, number of servings, instructions, etc. I have a subform for the ingredients. In the subform there is a combo box that lists the ingredient name(which is pulled form tblIngredients), cost, and measurement. Next to that is a field where we enter the amount of that ingredient we will use (this is called IngredientAmount from tblRecipeIngredient). Then I have an unbound textbox called txtCost and finally a textbox called Ingredient Cost where the total cost of that Ingredient will be placed. This is where I am having trouble. I was told to enter the following code in the data source of Ingredient Cost: =[txtCost]*[IngredientAmount]
Then in the combo box I am to enter the following code into After Update Event: Me!txtCost=Me!IngredientCost.Column(2)
But when I do this both text boxes are still empty. There is no error in the boxes they are just empty. Is there something else I need to do? If you have any suggestions I would be very grateful. If you need me to explain anything else please let me know.
thanks.
Chad
tblMeasure
MeasureID
MeasureName
tblIngredients
IngredientID
IngredientName
Amount
MeasureID
IngredientCost
tblRecipeIngredients
RecipeIngredientsID
RecipeID
IngredientID
IngredientAmount
MeasureID
tblRecipe
RecipeID
RecipeName
RecipeInstructions
Time to Prepare
Number of Servings
I have three forms for this so far. One is a simple form to enter in Measurement names (tablespoon, teaspoon, cup, etc.) Another is to enter in the Ingredients and their cost per measurement. The third is the main form, the recipe form. Here I have it setup to enter the recipe name, number of servings, instructions, etc. I have a subform for the ingredients. In the subform there is a combo box that lists the ingredient name(which is pulled form tblIngredients), cost, and measurement. Next to that is a field where we enter the amount of that ingredient we will use (this is called IngredientAmount from tblRecipeIngredient). Then I have an unbound textbox called txtCost and finally a textbox called Ingredient Cost where the total cost of that Ingredient will be placed. This is where I am having trouble. I was told to enter the following code in the data source of Ingredient Cost: =[txtCost]*[IngredientAmount]
Then in the combo box I am to enter the following code into After Update Event: Me!txtCost=Me!IngredientCost.Column(2)
But when I do this both text boxes are still empty. There is no error in the boxes they are just empty. Is there something else I need to do? If you have any suggestions I would be very grateful. If you need me to explain anything else please let me know.
thanks.
Chad