PC Review


Reply
Thread Tools Rate Thread

business_table relating to 2 copies of entity_table

 
 
Francis
Guest
Posts: n/a
 
      3rd Mar 2006
Ok, i have the following data structure:

business_table:
pk: businessID
business_name
buyerID (links to entity_table)
sellerID (links to entity_Table_1)

entity_table:
pk: entityID
entity_name
buyerID
sellerID

my question is, how do i change the name of entity_Table_1 to
seller_Table in Relationships interface, so i can easily understand and
read the structure.

I think in Relationships you don't change the name of copies or
instances of the same table (used a lot in self joins), you do this in
Query's interface.

Would like some comments upon this (btw thanks Allen for your example
with pedigrees in http://allenbrowne.com/ser-06.html).

Comments and Answers are appreciated thanks.

Francis
(Portugal)

 
Reply With Quote
 
 
 
 
John Vinson
Guest
Posts: n/a
 
      3rd Mar 2006
On 3 Mar 2006 04:37:14 -0800, "Francis" <(E-Mail Removed)> wrote:

>Ok, i have the following data structure:
>
>business_table:
>pk: businessID
>business_name
>buyerID (links to entity_table)
>sellerID (links to entity_Table_1)
>
>entity_table:
>pk: entityID
>entity_name
>buyerID
>sellerID
>
>my question is, how do i change the name of entity_Table_1 to
>seller_Table in Relationships interface, so i can easily understand and
>read the structure.
>
>I think in Relationships you don't change the name of copies or
>instances of the same table (used a lot in self joins), you do this in
>Query's interface.


I don't understand your structure. You have a BuyerID and a SellerID
in both tables, AND an EntityID in the Entity table. What is the
purpose of the BuyerID and SellerID fields in the Entity_Table?

As far as I know you cannot change the alias assigned in the
Relationships window (someone might be able to enlighten both of us on
how to do so), but you don't really need to; you can assign an alias
in a Query:

SELECT Business_Table.BusinessName, SellingEntity.Entity_Name AS
Seller, Buying_Entity.EntityName AS Buyer
FROM (Business_Table INNER JOIN Entity_Table AS SellingEntity
ON Business_Table.SellerID = SellingEntity.EntityID)
INNER JOIN Entity_Table AS BuyingEntity
ON Business_Table.SellerID = BuyingEntity.EntityID;


John W. Vinson[MVP]
 
Reply With Quote
 
Francis
Guest
Posts: n/a
 
      3rd Mar 2006
Thank you for your contribution John, in fact that structure is
redundant, and i posted it quite quickly and should give a more
carefull look in my post. I would find that the table structure im
looking forward is:

business_table:
pk: businessID
business_name
buyerID (links to entity_table)
sellerID (links to entity_Table_1)


entity_table:
pk: entityID
entity_name


The problem is that i want a Form that displays for any given entity
(doens't matter if it is a seller or buyer), list of businesses, she is
envolved with, (subform with business_table recordsource?) and controls
with buyerID and sellerID.

 
Reply With Quote
 
John Vinson
Guest
Posts: n/a
 
      4th Mar 2006
On 3 Mar 2006 14:04:40 -0800, "Francis" <(E-Mail Removed)> wrote:

>Thank you for your contribution John, in fact that structure is
>redundant, and i posted it quite quickly and should give a more
>carefull look in my post. I would find that the table structure im
>looking forward is:
>
>business_table:
>pk: businessID
>business_name
>buyerID (links to entity_table)
>sellerID (links to entity_Table_1)
>
>
>entity_table:
>pk: entityID
>entity_name
>
>
>The problem is that i want a Form that displays for any given entity
>(doens't matter if it is a seller or buyer), list of businesses, she is
>envolved with, (subform with business_table recordsource?) and controls
>with buyerID and sellerID.


The simplest way that comes to mind is to have a Form based on
EntityTable with TWO subforms, both based on BusinessTable; for one
subform use EntityID as the Master Link Field, BuyerID as the Child;
for the other use SellerID as the child.

Or, you could base the subform on a UNION query

SELECT Business_Name, "Seller" As Action, SellerID As Linker
FROM Business_Table
WHERE SellerID IS NOT NULL
UNION ALL
SELECT Business_Name, "Buyer", BuyerID
FROM Business_Table
WHERE BuyerID IS NOT NULL

and use Linker as the Child Link Field. This subform won't be
updateable, though!

John W. Vinson[MVP]
 
Reply With Quote
 
Francis
Guest
Posts: n/a
 
      9th Mar 2006
It's sorted thanks.

Francis

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Number of copies to print keep defaulting to 12 copies why? Boski Microsoft Excel Worksheet Functions 1 8th Oct 2009 05:33 PM
Deleting copies of backup copies of docs =?Utf-8?B?U3VzYW4gRyBH?= Windows XP Basics 2 1st Feb 2007 06:11 AM
copies of copies and lost photos miskairal Windows XP New Users 3 1st Jul 2006 01:47 AM
When will we see a fix of outlook creating multiple copies of emails? My record is 6 copies! Trond A. Noren Microsoft Outlook Installation 1 12th May 2005 10:41 AM
Will not print mutiple copies, only single copies Todd Ryan Windows XP Print / Fax 0 21st Jul 2003 01:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:29 PM.