Bill of Materials

  • Thread starter Thread starter murdock
  • Start date Start date
M

murdock

Guest
Hello all,

I've hit a stone wall in a project I'm working on. I need to build a bill of materials but I just can't get my head around the relationship structure required. This being because a part on the BOM may consist of a number of other parts......so the table [components] seems to refer back to itself in places, and I haven't a clue how to implement this.

I would really appreciate it if any of you could help with this as I've been stuck at it for days now. I did a search of the archives but it turned up nothing that helped solve this problem.

Best Regards
M.
 
David, I looked at that example before but it doesn't really solve my problem. I will ultimately be using a web browser as the interface and want to do all my coding/queries etc. there. I just want the DB to hold the relevent info. So all I want in the DB is a structure of Tables to store the info. It needs to be up to to 3rd normal form and have referential integrity.

Thanks for your response and sorry if this is a little complicated......but these are the restrictions I have placed on me!

Again, any further assistance would be greatly appreciated.
 
When a bill of materials refers to a parts list, and one of the parts contains other elements in the parts list, you have what is called an Assembly. I.e. it is a part that isn't elementary.

Where you are confused is that you are trying to see a two-step relationship as though it were a one-step relationship.

Make a new type of entry in your parts list. Call it an assembly. Give it a part number as though it had a unique existence.

Make an Assemblies table that is

tblAssembly
-- PartNo (PK)
-- ComponentPartNo (FK) - that points back to the parts table.
-- NumReqd

You have as many entries in this table as you need to describe the components in the assembly.

Now, to use this, you have to establish a relationship between the PartNo field in tblAssembly and your master parts table, but with the relationship being "all parts and any matching assemblies." THEN establish a second relationship between the Assembly's ComponentPartNo and the parts table.

When you want to expand on the part numbers, you have a parent-child relationship here. It appears to be cyclic, which in a way it is. So in queries or in the relationship diagram, you might have to add the parts table TWICE. (You can do that.) Then make the Part-to-Assembly relationship on the first copy and the Component-to-Part relationship on the second copy.

Now when you want a parts list that includes an assembly, you have to build a report/subreport case, where whenever you have an assembly you have to include the subreport.

If that seems to not give you just a flat-out parts list, you can use a UNION query here to your advantage. The examples for UNION queries in the Help files should be good enough to give you the basic idea.

For any bill of materials, the absolute list of parts is a union of all parts called out by number that AREN'T assemblies plus all parts referenced from the Assembly table for parts that ARE assemblies.

One trick I sometimes use is that I add a constant field in each segment of my UNION queries so I can identify whether the item came from table A, table B, table C, etc.

Now, things can get VERY nasty if you ever have the case that an assembly is itself an assembly. For now, let's cross that bridge if and when you come to it.

This is a conceptual discussion. Perhaps this is not what you want to implement. But you said you were having trouble getting your head around this problem. So if this provides only insight and no actual directions, at least I hope the insights are useful.
 
The_Doc_Man, Thanks for your response. I think you've hit the nail on the head with this one but I still ran into problems. When I tried to implement your suggestion I find that I can't enter data into either table because there are records required in the other table. Any idea how to get around this?
 

Users who are viewing this thread

Back
Top Bottom