D
dymondjack
Hello again, and again TIA for any input.
I'm trying to build some relationships between a few tables create an
effective BOM table for Parts, and I was wonder if someone might be able to
give a second opinion on my setup, as I have never really tried to tackle
something like this before.
A bit of background (brief as I can):
I've got my tblParts, which is fairly straightforward... ID, PartNumber,
Rev, etc, and I want to have a BOM setup for it. The thing is, each BOM item
can be one of three 'types'...
1) a Component Item
2) a Raw Material Item
3) a Purchased Part Item
The Raw Material and Purchased Parts are fairly straightforward as well,
each of the two has its own table (tblRawStocks and tblPurchasedParts), each
with a Autonumber PK. So to handle that I've got two junction tables set up,
jtblBOM_RawStocks and jtblBOM_PurchasedParts, to accomodate the many to many
relationship between Parts and BOM Items. As each of these 'types' has a
completely different set of properties to them, I believe they each need to
be in their own table, therefore my final BOM will be three seperate junction
tables. I do not see this being a particular issue later down the road.
The Problem:
The third junction table that I'm trying to set up is the one that I'm a bit
perplexed about. I need to set up a many to many relationship between
tblParts and tblParts. I've never tried doing this, and have no idea if its
the right way to go about it (I'm new to many-to-many's).
So here's what I have:
tblParts
fldID <-- Autnum, PK
...
...
jtblBOM_Components
fldID <-- Autonum, PK
fldPartID <-- Child of tblParts (the active part)
fldComponentID <-- Child of tblParts (the components of the active part)
I *think* this will allow me to have a Part with a BOM that can contain any
number of other Parts. I'm curious about how this relationship actually
works though. When I work in the relationship window, I've attempted this
two ways:
Method 1)
tblParts jtblBOM_Components
fldID fldID
fldPartID
fldComponentID
First I drag from tblParts.fldID to tblBOM_Components.fldPartID and setup a
one-to-many. Then, I tried dragging jtblBOM_Components.fldComponentID to
tblParts.fldID, and access gives me the option of deleting the existing
relationship or create a new one (or cancel).
If I create a new one using this method, and leave the existing, would this
create the correct relationship?
Method 2)
tblParts jtblBOM_Components tblParts_1
fldID fldID fldID
fldPartID
fldComponentID
So when I add the second tblParts to the relationship view, access suffixes
the table with "_1". I assume this is normal and won't effect anything, but
I don't know for sure. Doing it like this, I can drag from tblParts.fldID to
jtblBOM.fldPartID, and then drag tblParts_1.fldID to jtblBOM.fldComponentID,
and it acts as it normally does with other many-to-many's.
Is there any difference between these two methods? Unfortunately I know
very little (nothing, actually) about the 'inner workings' of relationships,
and have no idea if one was is better than the other (or even I should be
trying to set relations between the same table??).
If anyone has every run into a situation like this before and can offer some
advice on whether this is a valid relationship or not, I would be extremely
appreciative.
Sorry for the long post. Thanks again!! (hopefully my 'relationship' views
display correctly with the word wrap...)
--
Jack Leach
www.tristatemachine.com
- "First, get your information. Then, you can distort it at your leisure."
- Mark Twain
I'm trying to build some relationships between a few tables create an
effective BOM table for Parts, and I was wonder if someone might be able to
give a second opinion on my setup, as I have never really tried to tackle
something like this before.
A bit of background (brief as I can):
I've got my tblParts, which is fairly straightforward... ID, PartNumber,
Rev, etc, and I want to have a BOM setup for it. The thing is, each BOM item
can be one of three 'types'...
1) a Component Item
2) a Raw Material Item
3) a Purchased Part Item
The Raw Material and Purchased Parts are fairly straightforward as well,
each of the two has its own table (tblRawStocks and tblPurchasedParts), each
with a Autonumber PK. So to handle that I've got two junction tables set up,
jtblBOM_RawStocks and jtblBOM_PurchasedParts, to accomodate the many to many
relationship between Parts and BOM Items. As each of these 'types' has a
completely different set of properties to them, I believe they each need to
be in their own table, therefore my final BOM will be three seperate junction
tables. I do not see this being a particular issue later down the road.
The Problem:
The third junction table that I'm trying to set up is the one that I'm a bit
perplexed about. I need to set up a many to many relationship between
tblParts and tblParts. I've never tried doing this, and have no idea if its
the right way to go about it (I'm new to many-to-many's).
So here's what I have:
tblParts
fldID <-- Autnum, PK
...
...
jtblBOM_Components
fldID <-- Autonum, PK
fldPartID <-- Child of tblParts (the active part)
fldComponentID <-- Child of tblParts (the components of the active part)
I *think* this will allow me to have a Part with a BOM that can contain any
number of other Parts. I'm curious about how this relationship actually
works though. When I work in the relationship window, I've attempted this
two ways:
Method 1)
tblParts jtblBOM_Components
fldID fldID
fldPartID
fldComponentID
First I drag from tblParts.fldID to tblBOM_Components.fldPartID and setup a
one-to-many. Then, I tried dragging jtblBOM_Components.fldComponentID to
tblParts.fldID, and access gives me the option of deleting the existing
relationship or create a new one (or cancel).
If I create a new one using this method, and leave the existing, would this
create the correct relationship?
Method 2)
tblParts jtblBOM_Components tblParts_1
fldID fldID fldID
fldPartID
fldComponentID
So when I add the second tblParts to the relationship view, access suffixes
the table with "_1". I assume this is normal and won't effect anything, but
I don't know for sure. Doing it like this, I can drag from tblParts.fldID to
jtblBOM.fldPartID, and then drag tblParts_1.fldID to jtblBOM.fldComponentID,
and it acts as it normally does with other many-to-many's.
Is there any difference between these two methods? Unfortunately I know
very little (nothing, actually) about the 'inner workings' of relationships,
and have no idea if one was is better than the other (or even I should be
trying to set relations between the same table??).
If anyone has every run into a situation like this before and can offer some
advice on whether this is a valid relationship or not, I would be extremely
appreciative.
Sorry for the long post. Thanks again!! (hopefully my 'relationship' views
display correctly with the word wrap...)
--
Jack Leach
www.tristatemachine.com
- "First, get your information. Then, you can distort it at your leisure."
- Mark Twain