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  

Junction Tables



 
 
Thread Tools Display Modes
  #1  
Old December 20th, 2008, 03:15 PM posted to microsoft.public.access.tablesdbdesign
Andrew
external usenet poster
 
Posts: 688
Default Junction Tables

The examples for handeling many to many relationships (Access 2007) show the
creation of a junction table that includes 2 primary keys in one table, how
is this done?
--
Andrew
H.W. Lochner
  #2  
Old December 20th, 2008, 04:17 PM posted to microsoft.public.access.tablesdbdesign
Rick Brandt
external usenet poster
 
Posts: 4,354
Default Junction Tables

On Sat, 20 Dec 2008 07:15:01 -0800, Andrew wrote:

The examples for handeling many to many relationships (Access 2007) show
the creation of a junction table that includes 2 primary keys in one
table, how is this done?


No it contains ONE primary key consisting of multiple fields. Some of
those fields are foreign keys to one of the other tables and the others
are foreign keys to the remaining one.

Example...

Table1: PK=ID_1

Table2: PK=ID_2

Junction Table
Table3: PK= ID_1, ID_2

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
  #3  
Old December 20th, 2008, 07:21 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Junction Tables

On Sat, 20 Dec 2008 07:15:01 -0800, Andrew
wrote:

The examples for handeling many to many relationships (Access 2007) show the
creation of a junction table that includes 2 primary keys in one table, how
is this done?


It's *one* primary key consisting of two fields.

To create such a primary key, open the table in design view. Ctrl-click the
two (up to ten, actually) fields so they're both highlighted; then click the
Key icon on the toolbar.
--

John W. Vinson [MVP]
 




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 08:18 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.