INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Simple Way To Related Multiple Records To Multiple Records

Simple Way To Related Multiple Records To Multiple Records

(OP)
My situation that I'm very puzzled about is...
I have a project management database which has correspondences as well as projects. I'm trying to Have a way for Correspondence Item be related to Item 2 & 3. I'd also like to have Item also related to Item 4. All of them have a unique Primary Key (PK). I have been experimenting with using a separate table that just holds all of the PK's that ever had a relationship/link added & would use the Foreign Key (FK) as another field. Ultimately, I want my correspondence entry form to have a list box showing all of the items that are related to it & be able to add more or directly click on it to open it up. Does anyone know of a good resource to figure this out?

RE: Simple Way To Related Multiple Records To Multiple Records

You use terms that no one knows what you are talking about

Quote:

I'm trying to Have a way for Correspondence Item be related to Item 2 & 3
Huh? You need to talk in generalties

I think you want an easy way to do a many to many relationship, but I do not know what you are asking.

To do a many to many you need a linking table. This usually has a way to store two primary keys as foreign keys.

Example. Assume you are doing a track and field event. And you would have many participants to an event and a single participant could be in many events.

tbl_Athlete_Event
athleteID relates to the athlete table
eventID relates to the event table

then you would have data like

CODE -->

AthleteID  EventID
   1         a
   2         a
   1         b
   7         b
   4         c
   1         c 


so athlete 1 is in events a, b, c
and athelete 2 is in a

So what is your question?

RE: Simple Way To Related Multiple Records To Multiple Records

And you can also go the other way around:

AthleteID EventID
 1         a
 2         a
 1         b
 7         b
 4         c
 1         c  
 
In Event a participate Athlete 1 and 2
In Event b participate Athlete 1 and 7
In Event c participate Athlete 1 and 4

Many-to-many relation

Have fun.

---- Andy

There is a great need for a sarcasm font.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close