Help

Subtract values every time a table is logged

Topic Labels: Base design
902 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Ellouise_Houber
4 - Data Explorer
4 - Data Explorer

Hey guys,
made the shift over to air table from the good old days of microsoft access, but I am having troubles with an ingredient/inventory tracker I’m making.

Essentially: I need a table called ‘Ingredients in Stock’ each record is an ingredient and the first field is an amount calculated from another table of order amounts, ie: when the order form is filled out for a certain ingredient, the first field in the in stock table is populated with the logged amount ordered. All good so far.

No I have another side to the system where there’s recipes, with gram amounts for each ingredient and a log every time a recipe is made. Every time a recipe is made, I need the ingredient gram amounts in the recipe logged to populate another field in the in stock table to track the amount used. Then I would be making another field which subtracts amount used from amount ordered.

So the question is: best way to set up each recipe? All recipes in one table, with the ingredients going across horizontally or a new table for each recipe. And then, when I set up the form for logging what recipe has been made, how do I get the ingredient values in the recipe to populate my in stock ingredients list?

TLDR: end user fills out a form that has date, select the recipe made and how many batches by kg as an integer. I need the ingredient amounts from the recipe logged to populate the amount used field in the instock table so that I can keep a running total of how much ingredient is in stock.

Sorry if this doesn’t make sense, I can try to explain better if needed.

0 Replies 0