
Originally Posted by
rpeare
One point of order before I comment, in your MOLDREQ table, you do not need to store anything but the PK from the MOLDS table (the part name and part no can be found through linking the tables).
Secondly, unless all your orders consist of using one mold you likely want a structure that is more like: From my understanding a mold request will never have more than one mold. If something goes wrong, work is stopped, maintenance is done on the mold, a new mold request is submitted with a new work order number.
Work_Orders
WO_ID Cycles_Needed ------> other work order related fields, like date, customer etc
Work_Orders_Detail
WOD_ID WO_ID Mold_ID Cycles_Used ----> other detail related fields like number of copies required
so let's say you start an order with a specific mold but something happens and you need to replace that mold in the middle of the operation you cycles needed may not match your cycles actually used for a specific mold but you could sum the detail items of a work order to find that the order had been met in any query or report. It sounds like I need to create a pre-run and post-run form/table. The pre-run is the request (Work Order, Mold Number, Part Name, Part Number, Date, etc...). The post-run would contain (Comments, Cycles, etc...)
Now what you're asking to do is really a modified inventory management type system, but you do NOT want to store calculated values in your table.
In your molds table if you have a field that shows the maximum number of molds possible between maintenance cycles that is really all you need as long as your maintenance table and all tables that record the use of the mold have a date the mold was used/maintained in them. From there you can calculate how many cycles a mold has on it since it's last maintenance cycle plus you retain the ability to audit the maintenance schedule of a particular mold. Let's say that you retire a mold after 50,0000 uses, having this type of log would allow you to accurately calculate not only the short term maintenance cycle but the long term retirement of old molds.