473,657 Members | 2,661 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Relating Tables in a database automatically

I have an existing database, and I need to add another table to it. The
database tracks equipment, however I have a need to track ancillary
items which are purchased or added to some of the equipment separately.

In the existing table there is a serial number field, which is indexed
with no duplicates. In the new table there will be multiple entries
which must be related to the individual piece of equipment which is
entered in the 'primary' (existing) table.

_______________ _______________ _______________ _

I have used the table wizard on occasion, to split a table, and I note
that when it "splits" a table it sets up a field in each table which
seems to automatically relate the two new tables, and make them fully
relational.

I can't see in the help, or in the various reference manuals an
explanation of the mechanics of how this is accomplished.

Maybe this is something that Access keeps track of and does
automatically once the tables are related in the Relationships Window,
and I just am failing to grasp how the 'Relational' part of the database
works. If that is the case, though, then why the special fields
inserted into the two separate tables which result when using the Table
Wizard to split up a table?
_______________ _______________ _______________ _________

Can anyone explain, and demonstrate, how I can implement this automatic
method of relating tables so I could add my new table to the database
and have new record entries to the new table automatically relate to the
existing table as new entries are added?
(Or alternately, why I don't need to, and why??)

BlackFireNova

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
3 4480
Look up "Relationsh ips" in help.

P
"BlackFireN ova" <BF************ *****@myrealbox .com> wrote in message
news:3f******** *************@n ews.frii.net...
I have an existing database, and I need to add another table to it. The
database tracks equipment, however I have a need to track ancillary
items which are purchased or added to some of the equipment separately.

In the existing table there is a serial number field, which is indexed
with no duplicates. In the new table there will be multiple entries
which must be related to the individual piece of equipment which is
entered in the 'primary' (existing) table.

_______________ _______________ _______________ _

I have used the table wizard on occasion, to split a table, and I note
that when it "splits" a table it sets up a field in each table which
seems to automatically relate the two new tables, and make them fully
relational.

I can't see in the help, or in the various reference manuals an
explanation of the mechanics of how this is accomplished.

Maybe this is something that Access keeps track of and does
automatically once the tables are related in the Relationships Window,
and I just am failing to grasp how the 'Relational' part of the database
works. If that is the case, though, then why the special fields
inserted into the two separate tables which result when using the Table
Wizard to split up a table?
_______________ _______________ _______________ _________

Can anyone explain, and demonstrate, how I can implement this automatic
method of relating tables so I could add my new table to the database
and have new record entries to the new table automatically relate to the
existing table as new entries are added?
(Or alternately, why I don't need to, and why??)

BlackFireNova

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #2
PMB
The easiest way to create relationships I've found is create the second
table, then in the primary or parent table, put a field linking the two, use
lookup and link to the other table.

HTH

Michael
"BlackFireN ova" <BF************ *****@myrealbox .com> wrote in message
news:3f******** *************@n ews.frii.net...
I have an existing database, and I need to add another table to it. The
database tracks equipment, however I have a need to track ancillary
items which are purchased or added to some of the equipment separately.

In the existing table there is a serial number field, which is indexed
with no duplicates. In the new table there will be multiple entries
which must be related to the individual piece of equipment which is
entered in the 'primary' (existing) table.

_______________ _______________ _______________ _

I have used the table wizard on occasion, to split a table, and I note
that when it "splits" a table it sets up a field in each table which
seems to automatically relate the two new tables, and make them fully
relational.

I can't see in the help, or in the various reference manuals an
explanation of the mechanics of how this is accomplished.

Maybe this is something that Access keeps track of and does
automatically once the tables are related in the Relationships Window,
and I just am failing to grasp how the 'Relational' part of the database
works. If that is the case, though, then why the special fields
inserted into the two separate tables which result when using the Table
Wizard to split up a table?
_______________ _______________ _______________ _________

Can anyone explain, and demonstrate, how I can implement this automatic
method of relating tables so I could add my new table to the database
and have new record entries to the new table automatically relate to the
existing table as new entries are added?
(Or alternately, why I don't need to, and why??)

BlackFireNova

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #3
uh oh... time to learn something.

You need to create the "tblAncillaryIt ems" table...
In it you need an ID field for the Ancillary Item to uniquely identify
it. (AItemID)
Then you need the primary key (EquipmentID) from the original table,
"tblEquipme nt". Join on
tblEquipment.Eq uipmentID=tblAn cillaryItems.Eq uipmentID

cascade update = Yes.
cascade delete = ? (what happens when someone loses a piece of
equipment?)

*Or* Can a single piece of ancillary equipment go into several pieces
of equipment over time? then you have a different set of primary keys
for Ancillary Equipment... Might be time to crack open a database
theory book... maybe "Database Design for Mere Mortals" by Michael
Hernandez?
Nov 12 '05 #4

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

Similar topics

3
24022
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked tables in the database where the code resides. If we move the database with the data tables to a new directory, the links are no longer valid. I tried to update the links by changing the Connect property and refreshing: Set td = db.TableDefs(0)...
3
1771
by: Stephen | last post by:
It is possible to relate queries to tables, right? It seems logical but when I try to match my queries to any of the tables or even to each other it gives me a blank relationship. What could I possibly be doing wrong on this? Thanks for the help, Stephen
3
11813
by: Tym | last post by:
OK - daft question of the day time... If I have database A which contains all the live data, and Database B which contains linked tables to those is A (i.e. a front end) is there a way of seeing if any tables have been addedd to A and if so, programatically creating a linked table to the new tables? Failing this, can I programatically delete all linked tables, then link re-link to every table which appears in tableA?
2
7676
by: Randy | last post by:
I am new to Access and need to link to two tables with a case number. If I link using the Relationship feature will it automatically enter the case number in the child database if I put the case number in the main database like it does in Approach or do I have to do something different. When I tried to set up to autonumbers the link did not work correctly. Appreciate any help as I am new to Access.
3
4525
by: Odawg | last post by:
Hello All Database (Access) Guru's, I am a novice when it comes to databases and I know enough to get simple information for my needs. With that said, I was given an opportunity for improvement a database. heres the scenario or process that I am facing 1. A total of 3 text files are generated from the mainframe and save to a secure network share. In each text file only raw data
1
3039
by: Shizbart | last post by:
MS Access 97 Beginner/Moderate Level User I am trying to create a Database to track Workouts in MS Access 97. I have one Table named Workouts that contains the following Fields: Workout Code (e.g: U100), WorkoutActivity (e.g.: Bench Press: Flat Bench Straightbar) (note: this is the Primary Key of this Table), and Target Area (e.g.: Upper Body / Chest). A second Table named Workout_Log contains the following Fields: Date,...
1
1754
by: a Wellner | last post by:
I have a Database stored on the server, and a replica on a laptop, used for data collection in the field. The laptop is only connected to the network during synchronization. I am linking to tables in another database, maintained by another agency; the linked tables are used as the source for a lookup field. The data in the table I am linking to changes monthly. If I have the table linked I get a network error when I attempt to access the...
4
10686
by: sethington | last post by:
Here is my situation. I have ODBC Rights to a SQL database but I have 4 users who need to get to this information but because they are contractors they are not allowed to get there own ODBC access. So I wanted to create an Access Database using Linking Tables and then Create Local Tables from the Linking Tables. Then they would have a front end view to my newly created tables. Does anyone know how to do this where the data will...
3
2117
by: nimajneb via AccessMonster.com | last post by:
Can anyone offer me any insight on the following problem? I have an Access database on a company shared drive. I'm the designer and the only user (so far). Suddenly, any time I try to open a table, Access crashes... but if I look at that same data by *querying* the table (SELECT * FROM ), everything works fine. Even though my data seems fine *for now*, it's a little scary for me. Insight? Possible solutions?
0
8407
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8512
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.