A few weeks ago I recieved code similar to that listed below from lbass on this forum. It worked great as written. Then I copied and modified the code to what is shown.
As soon as I added the second formula, "timeinminutes" the "WeightinPounds" formula iterates for every instance of "timeinminutes" found in the "Routing" table.
Without "timeinminutes" the "WeightinPounds" works fine. I need both values on the report. Is there a way to calculate both without miscalculations?
There will be cases where multiple records exist in either the "Materials" table or the "Routing" table or both.
Thanks in advance.
Code:
//To be placed in the details section
whileprintingrecords;
numbervar WeightinPounds;
numbervar timeinminutes;
timeinminutes := timeinminutes + {Routing.CycleTime} + {Routing.SetupTime}/{QuoteDet.Qty1};
WeightinPounds := WeightinPounds + {Materials.PartWt}*{Materials.Qty}
As soon as I added the second formula, "timeinminutes" the "WeightinPounds" formula iterates for every instance of "timeinminutes" found in the "Routing" table.
Without "timeinminutes" the "WeightinPounds" works fine. I need both values on the report. Is there a way to calculate both without miscalculations?
There will be cases where multiple records exist in either the "Materials" table or the "Routing" table or both.
Thanks in advance.