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  

Table Relationship Question



 
 
Thread Tools Display Modes
  #1  
Old July 9th, 2009, 03:25 PM posted to microsoft.public.access.tablesdbdesign
Monet 138
external usenet poster
 
Posts: 7
Default Table Relationship Question

I have two tables, (A) is a detailed Location information table, the other
(B) is containing a list of Area/City/Town names. On table (A) there are two
columns for Area/City/Town, one listed as Primary and the other Secondary. I
want both of these fields to use the information from and be linked to table
(B) but am unsure how to go about this.

Here are my two guesses.
1. Setup another table (B2), where (B2).ID would be linked to (B).Area and
(B2).Area (which would just be an autonumber instead of text) would be linked
to (A).Secondary, while (B).ID is linked to (A).Primary.

2. Link (B).ID to (A).Primary in the Relationships window, and use a Form
which uses combo box queries of (B) for entering info into (A).Primary and
(A).Secondary. This would limit the entries into (A).Secondary to the list
within (B) but I don't see how (A).Secondary would be updated if a record
within (B) needed to be changed.

#1 seems incorrect in that I'm unsure how to make (B2) always contain the
same number of records as (B), such as when records were added or deleted.
#2 seems to have cascading update problems.

Thanks in advance for the help.

--
"Imagination is more important than Knowledge. Knowledge is limited,
Imagination encircles the world." ~Albert Einstein
  #2  
Old July 9th, 2009, 04:40 PM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Table Relationship Question

In the Relationships Window, add a 2nd copy of table B.
Access will alias it as B_1.

You can now create a relationship from A.PrimaryTown to B.Town, and another
relationship from A.SecondaryTown to B_1.Town.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Monet 138" wrote in message
...
I have two tables, (A) is a detailed Location information table, the other
(B) is containing a list of Area/City/Town names. On table (A) there are
two
columns for Area/City/Town, one listed as Primary and the other Secondary.
I
want both of these fields to use the information from and be linked to
table
(B) but am unsure how to go about this.

Here are my two guesses.
1. Setup another table (B2), where (B2).ID would be linked to (B).Area
and
(B2).Area (which would just be an autonumber instead of text) would be
linked
to (A).Secondary, while (B).ID is linked to (A).Primary.

2. Link (B).ID to (A).Primary in the Relationships window, and use a Form
which uses combo box queries of (B) for entering info into (A).Primary and
(A).Secondary. This would limit the entries into (A).Secondary to the
list
within (B) but I don't see how (A).Secondary would be updated if a record
within (B) needed to be changed.

#1 seems incorrect in that I'm unsure how to make (B2) always contain the
same number of records as (B), such as when records were added or deleted.
#2 seems to have cascading update problems.

Thanks in advance for the help.

--
"Imagination is more important than Knowledge. Knowledge is limited,
Imagination encircles the world." ~Albert Einstein


  #3  
Old July 9th, 2009, 05:01 PM posted to microsoft.public.access.tablesdbdesign
Monet 138
external usenet poster
 
Posts: 7
Default Table Relationship Question

Sweet! Extremely simple solution. Thanks!

--
"Imagination is more important than Knowledge. Knowledge is limited,
Imagination encircles the world." ~Albert Einstein


"Allen Browne" wrote:

In the Relationships Window, add a 2nd copy of table B.
Access will alias it as B_1.

You can now create a relationship from A.PrimaryTown to B.Town, and another
relationship from A.SecondaryTown to B_1.Town.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Monet 138" wrote in message
...
I have two tables, (A) is a detailed Location information table, the other
(B) is containing a list of Area/City/Town names. On table (A) there are
two
columns for Area/City/Town, one listed as Primary and the other Secondary.
I
want both of these fields to use the information from and be linked to
table
(B) but am unsure how to go about this.

Here are my two guesses.
1. Setup another table (B2), where (B2).ID would be linked to (B).Area
and
(B2).Area (which would just be an autonumber instead of text) would be
linked
to (A).Secondary, while (B).ID is linked to (A).Primary.

2. Link (B).ID to (A).Primary in the Relationships window, and use a Form
which uses combo box queries of (B) for entering info into (A).Primary and
(A).Secondary. This would limit the entries into (A).Secondary to the
list
within (B) but I don't see how (A).Secondary would be updated if a record
within (B) needed to be changed.

#1 seems incorrect in that I'm unsure how to make (B2) always contain the
same number of records as (B), such as when records were added or deleted.
#2 seems to have cascading update problems.

Thanks in advance for the help.

--
"Imagination is more important than Knowledge. Knowledge is limited,
Imagination encircles the world." ~Albert Einstein



 




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:01 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.