I tried this code but it gave an error atCouldn't find the object. There is no control named "Cost". There is a cost textbox for each ingredient (Cost1, Cost 2........Cost15). These controls do not get saved to the table. They are just used to calculate the total cost of the recipe by looking up the cost of each ingredient, adding them together and putting the result in the control named rec65. There is a naming pattern for the controls that are being added to the table row. They are named rec1 to rec 68.frmRecipeBox.Controls("Cost" & I).Value = Application.VLookup(myIng, MyRange, Res, 0) * myAmt
I am attaching a copy of my form and the complete macro so you can get a better idea. What if I changed the naming patterns to something like Ing1....Ing15; Amt1....Amt15, etc.
Thanks
Bookmarks