A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

One-To-Many Problem



 
 
Thread Tools Display Modes
  #1  
Old May 4th, 2004, 05:07 PM
Tom
external usenet poster
 
Posts: n/a
Default One-To-Many Problem

I need some help with table design. Below is the structure of just a few
tables from a database.

There is a One-To-Many relationship between "tblCorrespondence" to
"tblCorrespondenceActionOfficer", and also a One-To-Many relationship
between "tblCorrespondenceActionOfficer" and "tblComments".


tblCorrespondence
=================
- PK = CorrespondenceID


tblCorrespondenceActionOfficer
==============================
- PK = CorrespondenceActionOfficerID
- FK = CorrespondenceIDfk


tblComments
===========
- PK = CommentsID
- FK = CorrespondenceActionOfficerIDfk



Here the problem I'm having with this "junction table" structure. I need
another table (call it "tblNew") that follows the same schema like the
relationships from "tblCorrespondence" to "tblCorrespondenceActionOfficer"
to "
tblComments".

So, here's what I did..
- Copied "tblComments"
- Renamed it to "tblNew"
- Changed "CommentsID" to "NewID"
- Linked "tblNew" to "tblCorrespondenceActionOfficer";
"CorrespondenceActionOfficerID"


When I ran a query now on the 4 table, I don't see any records (not even
blank ones). I believe that I probably can't simply "splice in" the tblNew
into the existing schema.

Do I need to create yet another junction table diverting off
tblCorrespondence to "tblJunctionNew" to "tblNew"?


Thanks in advance,
Tom








  #2  
Old May 4th, 2004, 06:30 PM
Lynn Trapp
external usenet poster
 
Posts: n/a
Default One-To-Many Problem

Without knowing what your SQL is like, it's going to be hard for anyone to
give you a definitive answer. Could you post that? I'm a bit puzzled why
you would need another table that has essentially the same data as
tblComments.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


"Tom" wrote in message
...
I need some help with table design. Below is the structure of just a few
tables from a database.

There is a One-To-Many relationship between "tblCorrespondence" to
"tblCorrespondenceActionOfficer", and also a One-To-Many relationship
between "tblCorrespondenceActionOfficer" and "tblComments".


tblCorrespondence
=================
- PK = CorrespondenceID


tblCorrespondenceActionOfficer
==============================
- PK = CorrespondenceActionOfficerID
- FK = CorrespondenceIDfk


tblComments
===========
- PK = CommentsID
- FK = CorrespondenceActionOfficerIDfk



Here the problem I'm having with this "junction table" structure. I need
another table (call it "tblNew") that follows the same schema like the
relationships from "tblCorrespondence" to "tblCorrespondenceActionOfficer"
to "
tblComments".

So, here's what I did..
- Copied "tblComments"
- Renamed it to "tblNew"
- Changed "CommentsID" to "NewID"
- Linked "tblNew" to "tblCorrespondenceActionOfficer";
"CorrespondenceActionOfficerID"


When I ran a query now on the 4 table, I don't see any records (not even
blank ones). I believe that I probably can't simply "splice in" the

tblNew
into the existing schema.

Do I need to create yet another junction table diverting off
tblCorrespondence to "tblJunctionNew" to "tblNew"?


Thanks in advance,
Tom










  #3  
Old May 4th, 2004, 09:51 PM
Tom
external usenet poster
 
Posts: n/a
Default One-To-Many Problem

Lynn:

Thank you for your reply...

Not sure what SQL I would need to provide. At this moment, I simply need an
architecture that supports a 2nd table that also uses a One-To-Many
relationship in the same fashion as tblCorrespondence |
tblCorrespondenceActionOfficer | tblComments are linked.


When I stated that I copied tbl Comments and renamed the PK & FK, I also
meant that the table will also include new fields. So, never mind the "copy
tblComments"... instead I have an "identical relationship" to
tblCorrespondence between the tables.

Sorry for any confusion,
Tom




"Lynn Trapp" wrote in message
...
Without knowing what your SQL is like, it's going to be hard for anyone to
give you a definitive answer. Could you post that? I'm a bit puzzled why
you would need another table that has essentially the same data as
tblComments.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


"Tom" wrote in message
...
I need some help with table design. Below is the structure of just a

few
tables from a database.

There is a One-To-Many relationship between "tblCorrespondence" to
"tblCorrespondenceActionOfficer", and also a One-To-Many relationship
between "tblCorrespondenceActionOfficer" and "tblComments".


tblCorrespondence
=================
- PK = CorrespondenceID


tblCorrespondenceActionOfficer
==============================
- PK = CorrespondenceActionOfficerID
- FK = CorrespondenceIDfk


tblComments
===========
- PK = CommentsID
- FK = CorrespondenceActionOfficerIDfk



Here the problem I'm having with this "junction table" structure. I

need
another table (call it "tblNew") that follows the same schema like the
relationships from "tblCorrespondence" to

"tblCorrespondenceActionOfficer"
to "
tblComments".

So, here's what I did..
- Copied "tblComments"
- Renamed it to "tblNew"
- Changed "CommentsID" to "NewID"
- Linked "tblNew" to "tblCorrespondenceActionOfficer";
"CorrespondenceActionOfficerID"


When I ran a query now on the 4 table, I don't see any records (not even
blank ones). I believe that I probably can't simply "splice in" the

tblNew
into the existing schema.

Do I need to create yet another junction table diverting off
tblCorrespondence to "tblJunctionNew" to "tblNew"?


Thanks in advance,
Tom














  #4  
Old May 4th, 2004, 10:50 PM
Lynn Trapp
external usenet poster
 
Posts: n/a
Default One-To-Many Problem

Tom,
The problem does not relate to architecture for a 2nd table having a one to
many relationship to a parent table, but how you have joined the tables in
your query. That's why I asked to see the SQL statement that you tried and
got back no records with.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


"Tom" wrote in message
...
Lynn:

Thank you for your reply...

Not sure what SQL I would need to provide. At this moment, I simply need

an
architecture that supports a 2nd table that also uses a One-To-Many
relationship in the same fashion as tblCorrespondence |
tblCorrespondenceActionOfficer | tblComments are linked.


When I stated that I copied tbl Comments and renamed the PK & FK, I also
meant that the table will also include new fields. So, never mind the

"copy
tblComments"... instead I have an "identical relationship" to
tblCorrespondence between the tables.

Sorry for any confusion,
Tom




"Lynn Trapp" wrote in message
...
Without knowing what your SQL is like, it's going to be hard for anyone

to
give you a definitive answer. Could you post that? I'm a bit puzzled

why
you would need another table that has essentially the same data as
tblComments.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


"Tom" wrote in message
...
I need some help with table design. Below is the structure of just a

few
tables from a database.

There is a One-To-Many relationship between "tblCorrespondence" to
"tblCorrespondenceActionOfficer", and also a One-To-Many relationship
between "tblCorrespondenceActionOfficer" and "tblComments".


tblCorrespondence
=================
- PK = CorrespondenceID


tblCorrespondenceActionOfficer
==============================
- PK = CorrespondenceActionOfficerID
- FK = CorrespondenceIDfk


tblComments
===========
- PK = CommentsID
- FK = CorrespondenceActionOfficerIDfk



Here the problem I'm having with this "junction table" structure. I

need
another table (call it "tblNew") that follows the same schema like the
relationships from "tblCorrespondence" to

"tblCorrespondenceActionOfficer"
to "
tblComments".

So, here's what I did..
- Copied "tblComments"
- Renamed it to "tblNew"
- Changed "CommentsID" to "NewID"
- Linked "tblNew" to "tblCorrespondenceActionOfficer";
"CorrespondenceActionOfficerID"


When I ran a query now on the 4 table, I don't see any records (not

even
blank ones). I believe that I probably can't simply "splice in" the

tblNew
into the existing schema.

Do I need to create yet another junction table diverting off
tblCorrespondence to "tblJunctionNew" to "tblNew"?


Thanks in advance,
Tom
















  #5  
Old May 5th, 2004, 01:06 AM
Tom
external usenet poster
 
Posts: n/a
Default One-To-Many Problem

Lynn:

Hmh, this is odd...

Step1:
Here's what I have done in Query Design view --
- Added tables: tblCorrespondence, tblCorrespondenceActionOfficer,
tblComments
- Executed Table
- Although there are currently no records stored in the "testing database",
the query shows me that there at least no records stored (I see the fields 1
"empty line" plus the string "Autonumber" for the PKs
- The SQL code for this is below (#1)


Step2:
- Changed to Design View
- Added the "tblNew" to the query
- Executed query
- Here's where I believe the problem lies... I now CANNOT see that there are
no records stored in the database. I simply see the grey field names but I
don't see even a single blank line. This is why I thought I could not link
2 tables via the same FK to the overarching junction table's PK.
- The SQL code for this is below (#2)



Any thoughts what I'm doing wrong?


Thanks,
Tom



SQL QUERY #1:
SELECT tblCorrespondence.CorrespondenceID,
tblCorrespondence.ClassificationIDfk, tblCorrespondence.Author,
tblCorrespondenceActionOfficer.CorrespondenceActio nOfficerID,
tblCorrespondenceActionOfficer.CorrespondenceIDfk, tblComments.CommentsID,
tblComments.CorrespondenceActionOfficerIDfk, tblComments.Comment FROM
tblCorrespondence INNER JOIN (tblCorrespondenceActionOfficer INNER JOIN
tblComments ON tblCorrespondenceActionOfficer.CorrespondenceActio nOfficerID
= tblComments.CorrespondenceActionOfficerIDfk) ON
tblCorrespondence.CorrespondenceID =
tblCorrespondenceActionOfficer.CorrespondenceIDfk;

SQL QUERY #2:
SELECT tblCorrespondence.CorrespondenceID,
tblCorrespondence.ClassificationIDfk, tblCorrespondence.Author,
tblCorrespondenceActionOfficer.CorrespondenceActio nOfficerID,
tblCorrespondenceActionOfficer.CorrespondenceIDfk, tblComments.CommentsID,
tblComments.CorrespondenceActionOfficerIDfk, tblComments.Comment,
tbNew.NewID, tbNew.CorrespondenceActionOfficerIDfk, tbNew.NewField FROM
(tblCorrespondence INNER JOIN (tblCorrespondenceActionOfficer INNER JOIN
tblComments ON tblCorrespondenceActionOfficer.CorrespondenceActio nOfficerID
= tblComments.CorrespondenceActionOfficerIDfk) ON
tblCorrespondence.CorrespondenceID =
tblCorrespondenceActionOfficer.CorrespondenceIDfk) INNER JOIN tbNew ON
tblCorrespondenceActionOfficer.CorrespondenceActio nOfficerID =
tbNew.CorrespondenceActionOfficerIDfk;












"Lynn Trapp" wrote in message
...
Tom,
The problem does not relate to architecture for a 2nd table having a one

to
many relationship to a parent table, but how you have joined the tables in
your query. That's why I asked to see the SQL statement that you tried and
got back no records with.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


"Tom" wrote in message
...
Lynn:

Thank you for your reply...

Not sure what SQL I would need to provide. At this moment, I simply

need
an
architecture that supports a 2nd table that also uses a One-To-Many
relationship in the same fashion as tblCorrespondence |
tblCorrespondenceActionOfficer | tblComments are linked.


When I stated that I copied tbl Comments and renamed the PK & FK, I also
meant that the table will also include new fields. So, never mind the

"copy
tblComments"... instead I have an "identical relationship" to
tblCorrespondence between the tables.

Sorry for any confusion,
Tom




"Lynn Trapp" wrote in message
...
Without knowing what your SQL is like, it's going to be hard for

anyone
to
give you a definitive answer. Could you post that? I'm a bit puzzled

why
you would need another table that has essentially the same data as
tblComments.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


"Tom" wrote in message
...
I need some help with table design. Below is the structure of just

a
few
tables from a database.

There is a One-To-Many relationship between "tblCorrespondence" to
"tblCorrespondenceActionOfficer", and also a One-To-Many

relationship
between "tblCorrespondenceActionOfficer" and "tblComments".


tblCorrespondence
=================
- PK = CorrespondenceID


tblCorrespondenceActionOfficer
==============================
- PK = CorrespondenceActionOfficerID
- FK = CorrespondenceIDfk


tblComments
===========
- PK = CommentsID
- FK = CorrespondenceActionOfficerIDfk



Here the problem I'm having with this "junction table" structure.

I
need
another table (call it "tblNew") that follows the same schema like

the
relationships from "tblCorrespondence" to

"tblCorrespondenceActionOfficer"
to "
tblComments".

So, here's what I did..
- Copied "tblComments"
- Renamed it to "tblNew"
- Changed "CommentsID" to "NewID"
- Linked "tblNew" to "tblCorrespondenceActionOfficer";
"CorrespondenceActionOfficerID"


When I ran a query now on the 4 table, I don't see any records (not

even
blank ones). I believe that I probably can't simply "splice in"

the
tblNew
into the existing schema.

Do I need to create yet another junction table diverting off
tblCorrespondence to "tblJunctionNew" to "tblNew"?


Thanks in advance,
Tom


















  #6  
Old May 5th, 2004, 06:31 PM
Lynn Trapp
external usenet poster
 
Posts: n/a
Default One-To-Many Problem

Tom,
Let me suggest that you put some records in your test database to make sure
that Query 2 will not pull any records. The fact that you do not see a blank
line is an indication that the query is not updateable. If you have records
in the tables, it may very well pull those records. However, on the surface,
it looks like query 2 is way too complex to be updateable.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


"Tom" wrote in message
...
Lynn:

Hmh, this is odd...

Step1:
Here's what I have done in Query Design view --
- Added tables: tblCorrespondence, tblCorrespondenceActionOfficer,
tblComments
- Executed Table
- Although there are currently no records stored in the "testing

database",
the query shows me that there at least no records stored (I see the fields

1
"empty line" plus the string "Autonumber" for the PKs
- The SQL code for this is below (#1)


Step2:
- Changed to Design View
- Added the "tblNew" to the query
- Executed query
- Here's where I believe the problem lies... I now CANNOT see that there

are
no records stored in the database. I simply see the grey field names but

I
don't see even a single blank line. This is why I thought I could not

link
2 tables via the same FK to the overarching junction table's PK.
- The SQL code for this is below (#2)



Any thoughts what I'm doing wrong?


Thanks,
Tom



SQL QUERY #1:
SELECT tblCorrespondence.CorrespondenceID,
tblCorrespondence.ClassificationIDfk, tblCorrespondence.Author,
tblCorrespondenceActionOfficer.CorrespondenceActio nOfficerID,
tblCorrespondenceActionOfficer.CorrespondenceIDfk, tblComments.CommentsID,
tblComments.CorrespondenceActionOfficerIDfk, tblComments.Comment FROM
tblCorrespondence INNER JOIN (tblCorrespondenceActionOfficer INNER JOIN
tblComments ON

tblCorrespondenceActionOfficer.CorrespondenceActio nOfficerID
= tblComments.CorrespondenceActionOfficerIDfk) ON
tblCorrespondence.CorrespondenceID =
tblCorrespondenceActionOfficer.CorrespondenceIDfk;

SQL QUERY #2:
SELECT tblCorrespondence.CorrespondenceID,
tblCorrespondence.ClassificationIDfk, tblCorrespondence.Author,
tblCorrespondenceActionOfficer.CorrespondenceActio nOfficerID,
tblCorrespondenceActionOfficer.CorrespondenceIDfk, tblComments.CommentsID,
tblComments.CorrespondenceActionOfficerIDfk, tblComments.Comment,
tbNew.NewID, tbNew.CorrespondenceActionOfficerIDfk, tbNew.NewField FROM
(tblCorrespondence INNER JOIN (tblCorrespondenceActionOfficer INNER JOIN
tblComments ON

tblCorrespondenceActionOfficer.CorrespondenceActio nOfficerID
= tblComments.CorrespondenceActionOfficerIDfk) ON
tblCorrespondence.CorrespondenceID =
tblCorrespondenceActionOfficer.CorrespondenceIDfk) INNER JOIN tbNew ON
tblCorrespondenceActionOfficer.CorrespondenceActio nOfficerID =
tbNew.CorrespondenceActionOfficerIDfk;












"Lynn Trapp" wrote in message
...
Tom,
The problem does not relate to architecture for a 2nd table having a one

to
many relationship to a parent table, but how you have joined the tables

in
your query. That's why I asked to see the SQL statement that you tried

and
got back no records with.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


"Tom" wrote in message
...
Lynn:

Thank you for your reply...

Not sure what SQL I would need to provide. At this moment, I simply

need
an
architecture that supports a 2nd table that also uses a One-To-Many
relationship in the same fashion as tblCorrespondence |
tblCorrespondenceActionOfficer | tblComments are linked.


When I stated that I copied tbl Comments and renamed the PK & FK, I

also
meant that the table will also include new fields. So, never mind the

"copy
tblComments"... instead I have an "identical relationship" to
tblCorrespondence between the tables.

Sorry for any confusion,
Tom




"Lynn Trapp" wrote in message
...
Without knowing what your SQL is like, it's going to be hard for

anyone
to
give you a definitive answer. Could you post that? I'm a bit

puzzled
why
you would need another table that has essentially the same data as
tblComments.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


"Tom" wrote in message
...
I need some help with table design. Below is the structure of

just
a
few
tables from a database.

There is a One-To-Many relationship between "tblCorrespondence" to
"tblCorrespondenceActionOfficer", and also a One-To-Many

relationship
between "tblCorrespondenceActionOfficer" and "tblComments".


tblCorrespondence
=================
- PK = CorrespondenceID


tblCorrespondenceActionOfficer
==============================
- PK = CorrespondenceActionOfficerID
- FK = CorrespondenceIDfk


tblComments
===========
- PK = CommentsID
- FK = CorrespondenceActionOfficerIDfk



Here the problem I'm having with this "junction table" structure.

I
need
another table (call it "tblNew") that follows the same schema like

the
relationships from "tblCorrespondence" to
"tblCorrespondenceActionOfficer"
to "
tblComments".

So, here's what I did..
- Copied "tblComments"
- Renamed it to "tblNew"
- Changed "CommentsID" to "NewID"
- Linked "tblNew" to "tblCorrespondenceActionOfficer";
"CorrespondenceActionOfficerID"


When I ran a query now on the 4 table, I don't see any records

(not
even
blank ones). I believe that I probably can't simply "splice in"

the
tblNew
into the existing schema.

Do I need to create yet another junction table diverting off
tblCorrespondence to "tblJunctionNew" to "tblNew"?


Thanks in advance,
Tom




















 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:32 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.