473,513 Members | 2,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Relationship to two dissimilar primary tables

Below are three tables representing a simplified version of what I'm
trying to do. In each table, its "UniqueID" is an AutoNumber field, and
is the table's primary key.

I would like to be able to use one phone table that can be related to
both tblModel and tblVendor. tblModel and tblVendor contain dissimilar
fields. The ForeignKey in tblPhone would be the UniqueID of a row in
either tblModel or tblVendor.

Furthermore, each of these relationships can be one-to-many, the "many"
being on the tblPhone end.

When I attempt to establish these relationships, Access will not allow
it. I can kind of understand why this may be...for example, tblModel
could have a UniqueID 7, and so could tblVendor.

I would like to be able to use a single phone table instead of one each
for tblModel and tblVendor for a few reasons:
- I don't want to have to define two tables, especially if fields are
added later.
- If I want to run a query for all phone numbers in the database, that
query would me much simpler if it had to be run against one table only.
- There may be a couple more tables that need to have a relationship
with tblPhone, so if I could just add such a table and establish the
relationship, it would be quick and easy.

Perhaps what I'm trying to do can't be done. However, if someone
has an alternative that gives me the same end result, I'd be
interested in hearing it. I really don't want to have to set up a
separate phone table for each table that needs a phone table
relationship.
tblModel
---------
UniqueID
ModelName
Time
Date
tblVendor
---------
UniqueID
Address
Contact
tblPhone
-----------
UniqueID
ForeignKey
PhoneNumber

Jan 24 '07 #1
2 1216
gcloise,
<gc*****@hotmail.comwrote in message
news:11**********************@q2g2000cwa.googlegro ups.com...
Below are three tables representing a simplified version of what I'm
trying to do. In each table, its "UniqueID" is an AutoNumber field, and
is the table's primary key.

I would like to be able to use one phone table that can be related to
both tblModel and tblVendor. tblModel and tblVendor contain dissimilar
fields. The ForeignKey in tblPhone would be the UniqueID of a row in
either tblModel or tblVendor.

Furthermore, each of these relationships can be one-to-many, the "many"
being on the tblPhone end.

When I attempt to establish these relationships, Access will not allow
it. I can kind of understand why this may be...for example, tblModel
could have a UniqueID 7, and so could tblVendor.

I would like to be able to use a single phone table instead of one each
for tblModel and tblVendor for a few reasons:
- I don't want to have to define two tables, especially if fields are
added later.
- If I want to run a query for all phone numbers in the database, that
query would me much simpler if it had to be run against one table only.
- There may be a couple more tables that need to have a relationship
with tblPhone, so if I could just add such a table and establish the
relationship, it would be quick and easy.

Perhaps what I'm trying to do can't be done. However, if someone
has an alternative that gives me the same end result, I'd be
interested in hearing it. I really don't want to have to set up a
separate phone table for each table that needs a phone table
relationship.
tblModel
---------
UniqueID
ModelName
Time
Date
tblVendor
---------
UniqueID
Address
Contact
tblPhone
-----------
UniqueID
ForeignKey
PhoneNumber

Jan 24 '07 #2
gcloise,

You could add two foreign key columns to the tblPhone table, ModelID and
VendorID. If a phone number is associated with a Model and a Vendor, then
both columns would be populated. If not, only one column would be populated
and the other would be null.

-- Bill

<gc*****@hotmail.comwrote in message
news:11**********************@q2g2000cwa.googlegro ups.com...
Below are three tables representing a simplified version of what I'm
trying to do. In each table, its "UniqueID" is an AutoNumber field, and
is the table's primary key.

I would like to be able to use one phone table that can be related to
both tblModel and tblVendor. tblModel and tblVendor contain dissimilar
fields. The ForeignKey in tblPhone would be the UniqueID of a row in
either tblModel or tblVendor.

Furthermore, each of these relationships can be one-to-many, the "many"
being on the tblPhone end.

When I attempt to establish these relationships, Access will not allow
it. I can kind of understand why this may be...for example, tblModel
could have a UniqueID 7, and so could tblVendor.

I would like to be able to use a single phone table instead of one each
for tblModel and tblVendor for a few reasons:
- I don't want to have to define two tables, especially if fields are
added later.
- If I want to run a query for all phone numbers in the database, that
query would me much simpler if it had to be run against one table only.
- There may be a couple more tables that need to have a relationship
with tblPhone, so if I could just add such a table and establish the
relationship, it would be quick and easy.

Perhaps what I'm trying to do can't be done. However, if someone
has an alternative that gives me the same end result, I'd be
interested in hearing it. I really don't want to have to set up a
separate phone table for each table that needs a phone table
relationship.
tblModel
---------
UniqueID
ModelName
Time
Date
tblVendor
---------
UniqueID
Address
Contact
tblPhone
-----------
UniqueID
ForeignKey
PhoneNumber

Jan 24 '07 #3

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

Similar topics

28
2184
by: Jeff Lanfield | last post by:
Suppose I have users that can belong to organizations. Organizations are arranged in a tree. Each organization has only one parent organization but a user maybe a member of multiple organizations....
2
2127
by: Todd D. Levy | last post by:
I have a primary table (containing basic contact information) and a number of subsidiary tables (containing various additional information) for employees. Most of the subsidiary tables have a...
2
2041
by: Marco Simone | last post by:
Hi, I have 4 tables, tblCompany, tblA, tblB and tblC. tblA, tblB and tblC contain same type of data, they should be in one table, but since there are many fields, I split it into 3 tables. Each...
2
3052
by: Mindy | last post by:
Hey, I want to create links between my two tables. The primary keys of these two tables are character variables, with length =11. I followed exactly the instruction of Dummuy Book for ACCESS...
3
1461
by: shawnews | last post by:
Ok...I'll first describe briefly what I've done. Working from a paper form with over 200 fields - broken into 10 areas, I created a database with 10 tables. I then created a form using those 10...
1
1367
by: adham | last post by:
Hey there, Im not even sure if im using the terminology correctly. Anyway heres my questions. I have a three tables. The main table has two ID fields. A website id, which is the primary key in...
11
10603
by: RobertJohn | last post by:
Hi all I am using Access 2007 to start a small home library application, and so far it has two tables. 1. Books, with fields Book_ID (Primary Key) and Title, and 2. Authors, with fields...
4
3087
by: PW | last post by:
Hi, I set up a relationship between two tables with the itineraryid fields in both tables: tblDailyItinerary tblDailyMeals I have a form that writes a record to tblDailyItinerary that...
6
4047
by: NicoleCartrette | last post by:
Going back to school is easier said than done.. This was posted to an older thread earlier but I don't think it got any attention. Your help is appreciated Professor requires we create a...
0
7254
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,...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7094
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...
0
5677
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,...
1
5079
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
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...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
452
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...

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.