473,386 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Oganization Problem

Hello

I would like to be able to keep a list of all the parts that are on a
piece of equipment. I have a table of all the equipment (about 50) and
a table of all the parts (hundreds). This would be a many-to-many
relationship since each peice of equipment can have any number of parts
and each part may be found on any number of equipment. How do I relate
these two?

My first thought was to make a table for each peice of equipment, but
I'm thinking that there has to be a better way. i've never related a
many-to-many before. I'm obviously new to Access and would like to
learn how this can be done.

Thank you for you help

Jer

Aug 22 '06 #1
7 1154
Hi Jer

You need a table for the equipment, another for the parts, and a third to
make the many-to-many relationship.

The third table needs only the id of the equipment and the id of the part,
and potentially a quantity field, notes etc. Think of it as a BOM (Bill Of
Materials). If you are tracking bolts for example you would need the
quantity field. Notes are always handy.

The relationships between the equipment and parts tables to the third table
would be the usual one-to-many.

Jeff Pritchard
________________
Asken Research Pty. Ltd.
Access Database Developers
http://www.asken.com.au

"jer84" <je*******@gmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Hello

I would like to be able to keep a list of all the parts that are on a
piece of equipment. I have a table of all the equipment (about 50) and
a table of all the parts (hundreds). This would be a many-to-many
relationship since each peice of equipment can have any number of parts
and each part may be found on any number of equipment. How do I relate
these two?

My first thought was to make a table for each peice of equipment, but
I'm thinking that there has to be a better way. i've never related a
many-to-many before. I'm obviously new to Access and would like to
learn how this can be done.

Thank you for you help

Jer

Aug 22 '06 #2
Hi Jeff

Thank you so much. I couldn't think of how to manage with just the two
tables. This will help so much and save me from making an an absurd
database...

So the third table would hold for example:

equipment1 part1
equipment1 part2
equipment2 part2
equipment2 part3
etc.

This is what you mean, right?

Thanks again
Jeremy

Aug 22 '06 #3
One more thing:

What would I use as a key? An auto-number?

Thanks again

Jer

Aug 22 '06 #4
jer84 wrote:
One more thing:

What would I use as a key? An auto-number?

Thanks again

Jer
Dead on, on both guesses. You /could/ opt to use equipment and part to
create an index to ensure uniqueness in lieu of autonumber, but this
method is a but more difficult to maintain.

--
Smartin
Aug 23 '06 #5
"jer84" <je*******@gmail.comwrote in
news:11**********************@p79g2000cwp.googlegr oups.com:
Hello

I would like to be able to keep a list of all the parts that
are on a piece of equipment. I have a table of all the
equipment (about 50) and a table of all the parts (hundreds).
This would be a many-to-many relationship since each peice of
equipment can have any number of parts and each part may be
found on any number of equipment. How do I relate these two?

My first thought was to make a table for each peice of
equipment, but I'm thinking that there has to be a better way.
i've never related a many-to-many before. I'm obviously new to
Access and would like to learn how this can be done.

Thank you for you help

Jer
Basically, you create two tables, PARTS, which contains one row
for each part, and a second table which contains
ParentPart,ChildPart,Quantity and optionally a reference
designator or serial number. I've seen this named Assmbly, BOM
or Structure. The primary hey for this is an index on both
ParentPart and ChildPart

parentPart ChildPart Qty
Part1 Part2 1
part1 Part3 6
Part2 Part3 12

A ParentPart may also be a childPart, and the issue is to go
through the structure, calling out each child recursively until
there are no more children. You can write this off to a
temporary table or to a treeview list, or just print it out.

Part1
..Part2,1
...Part3,12
..Part3,6
etc.

research info on creating a Bill of Materials database.
http://groups.google.com/group/comp.databases.ms-
access/browse_frm/thread/297c01f1d5257aef/818b9d061280179e?
lnk=gst&q=quintal+Explosion&rnum=3#818b9d061280179 e

is also http://tinyurl.com/ntfgx

shows one way to do that. iirc, the code needs a little
tweaking.
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Aug 23 '06 #6
You could add a no dups index using both fields. That will stop you
inadvertently adding a part more than once. However, sometimes this is
valid. For example, adding multiple parts the same with unique notes about
installation would require the ability to add a part more than once. So your
call on that.

As far as a primary index, always a good idea to have one. But remember that
indexes should only be added if useful. Indexes have to be maintained and
consume both space and time.

If you don't have the no dups index I mentioned above then probably add a
auto number field for this. But what will you use it for?

I can't imagine why you would add any new tables related to this one!

Jeff Pritchard
________________
Asken Research Pty. Ltd.
Access Database Developers
http://www.asken.com.au

"jer84" <je*******@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
One more thing:

What would I use as a key? An auto-number?

Thanks again

Jer

Aug 23 '06 #7
Thank you for all the help. It's working great!

Aug 23 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in...
11
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class...
0
by: Refky Wahib | last post by:
Hi I need Technical Support I finished a Great project using .Net and SQL Server and .Net Mobile Control My Business case is to implement this Program to accept about 1 Million concurrent...
9
by: Sudesh Sawant | last post by:
Hello, We have an application which communicates using remoting. There is a server which is a Windows Service. The server exposes an object which is a singleton. The client is a Web Application...
117
by: Peter Olcott | last post by:
www.halting-problem.com
17
by: Jon Slaughter | last post by:
I'm having a little trouble understanding what the slicing problem is. In B.S.'s C++ PL3rdEd he says "Becayse the Employee copy functions do not know anything about Managers, only the Employee...
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.