Results 1 to 3 of 3
  1. #1
    skier4life is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    2

    Cool Help with relationships!!!


    Hi guys,
    Here is my problem. As part of my internship at an investment firm I'm creating a database that contains all the major timberland owners in the US. My main table has about 300 firms/organizations that own timberland. My primary key in that table is simply an auto number that gives each entry a unique "Owner ID". One of the tables I'm trying to link in has all recent timberland transactions. I painstakingly went through the entire transactions table and looked for buyers and sellers that I already had in my main timberland owners database. If I found one, I entered the unique owner ID next to either the buyer or the seller. Therefore, I have two fields, buyer and seller ID that match up to the numbers in the primary key of my main table. What I want to do is form relationships between the owner ID column in my main table and both the seller and the buyer ID columns in my second table. That way, I can preform queries such as "Give me all recent transactions that Plum Creek was involved in". I would enter in plum creek under criteria for firm/organization in the field from my main table, and I would want the search to pull any line from my second table where plum creek was listed as the buyer or seller. This works if I only have one relationship say between the "owner ID" and "Seller ID" fields, but then I can only bring up recent transactions where plum creek is the seller. What I want is it to pull from both seller ID and buyer ID columns when there is a match with plum creek. Any time I try this double relationship, I either get no results since it wants both the seller ID and the buyer ID to match (which will never happen) or I get an error about an ambiguous outer join. Any idea how to do this?? Do i need two different recent transaction tables? Any help would be MUCH appreciated, and my boss would love me Click image for larger version. 

Name:	Relationships.png 
Views:	10 
Size:	95.5 KB 
ID:	12720Click image for larger version. 

Name:	Query.png 
Views:	9 
Size:	116.4 KB 
ID:	12721Click image for larger version. 

Name:	Transactions.png 
Views:	6 
Size:	141.2 KB 
ID:	12722

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    You need the same relationship in the query that you have in relationships: an aliased copy of the Firm/Organization table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    you've created a circular reference in the middle image, just like your references you need to add your firm/organization table again and link it appropriately (BuyerID to Timb Owner ID)

    Just a couple of notes. You really, really want to stay away from spaces and other special characters (/ for example) ANY database object names (table names, field names, report names, query names etc) they can cause a lot of problems, for instance / indicates division. It's better to stay away from them if at all possible.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Relationships
    By snowboarder234 in forum Database Design
    Replies: 14
    Last Post: 02-29-2012, 04:53 PM
  2. Help with relationships
    By clive2011 in forum Access
    Replies: 5
    Last Post: 09-14-2011, 03:00 PM
  3. Relationships
    By neo651 in forum Database Design
    Replies: 2
    Last Post: 08-30-2011, 08:38 AM
  4. One to One Relationships
    By ketbdnetbp in forum Database Design
    Replies: 1
    Last Post: 04-27-2011, 11:22 AM
  5. Relationships again
    By BarbT in forum Access
    Replies: 2
    Last Post: 11-09-2010, 04:12 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums