Hello,
I'm having trouble getting the data I need from a query, here is the background:
I am working on a database for costing meals to go on restaurant menus.
I have a the following Tables:
- T_Dishes
- T_Food_Products
The main form is based on T_Dishes which allows the user to complete various fields including Dish_Name & upto 15 ingredients in fields 'Cbo_Ingredient_1', 'Cbo_Ingredient_2' etc (These are combo boxes that retrieve Product_Name and Wholesale_Price_Per_Unit from T_Food Products) and then the user completes the quantity used of each ingredient in fields 'Txt_Qty_1', 'Txt_Qty_2' etc
Using the 'Wholesale_Price_Per_Unit' data, another field 'Txt_Dish_Cost' then calculates the total of each ingredient and adds them together
e.g. sum([Cbo_Ingredient_1].Column(2)*[Txt_Qty_1])+([Cbo_Ingredient_2].Column(2)*[Txt_Qty_2]) etc
Now this is all fine but I want to be able to use this result elsewhere in the database (Other forms & reports) but I do not want to store a calculated value.
My hope was to create a query that could perform the same calculation that the form does and then base other forms on said query.
My ideal query for this scenario would have the following output fields:
Dish_Name & Dish_Cost, nothing else is required at this stage.
The problem I seem to have is that unlike in the form, I can't reference '.column(2)' in my query criteria . . . and despite many hours working on a solution I've gone round in circles and ended up with nothing . . .
Hope this makes sense
Many thanks in advance!!