serax
07-25-2004, 06:49 PM
Alright I need a database that can support the following information and I am not sure where to begin
I have about 15 items that each have anywhere for 10-200 parts for each item, now I need to track what parts we need by part # and description, and the cost for the part. Then I need to be able to make a report to list all the parts we need with discriptions amount needed cost per and total cost .
If some one could help I would gfreatly appreciate it
Exodus
07-26-2004, 09:57 AM
Sounds like you need two tables.
One that contains Items and one that contains parts
Have a unique idenifier for the item and put that in the parts table for all related parts. that way you can link the two tables together to see which
items need which parts.
Pat Hartman
07-26-2004, 01:19 PM
In all the manufacturing systems that I've worked with Items and Parts are stored in the same database. If you want to establish business rules that say that an End Item cannot be referenced as a part, add an EndItemFlg to the Part table and then programatically enforce the business rule.
The second table makes the relationship between 1 part (or end item) and another part. This structure lets you create a complete bill of material or just a simple two-level structure. To create this relationship, add tblBOM to the Relationship window once and add tblPart to the relationship twice. Draw the two relationships by connecting PartIDParent to PartID in the first instance of tblPart and by connecting PartIDChild to PartID in the second instance of tblPart. Enforce RI and select Cascade Delete.
tblBOM
PartIDParent (primary key fld1)
PartIDChild (primary key fld2)
Quantity
Exodus
07-26-2004, 02:01 PM
Please don't think I was refering to serperate databases for the tables.
I missused the termonology Link I did mean relationship.
Pat Hartman
07-26-2004, 06:33 PM
It sounded to me like you were defining a 1 (item) to many (parts) relationship. But that is unlikely to be the case here. The relationship would normally be many-to-many since any part could be part of many items and any item could be made up of many parts.
A many-to-many relationship normally takes three tables to implement. But in this case, two of the tables (item and part) are actually the same table. They should not be in separate tables. So the relation table connects twice to the parts table to relate one part (item) to another.
Exodus
07-27-2004, 09:06 AM
Well your right about the one to many.
I did not think about a part could be used for more than one item.
Very good point.
The more I learn the more I know I know nothing.
Thanks Pat