Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relationships/ Keys 1

Status
Not open for further replies.

cwinnyk

Programmer
May 27, 2003
62
US
Ok, this should be an easy one to answer (I hope).

I have two table linked together, "Companies" and "Contacts". I have the relaztionship set so CompanyID (Primary Key) on "Companies" relates one-to-many to CompanyID on "Contacts".

I enter two companies into my "Companies" table, then add some contacts into my contacts table, some of which are for "Company A" and some for "Company B".

Now, when I go back to my "Companies" table, and I click on the plus sign next to "Company A", my Contacts table comes up with contacts from both companies, instead of just "Company A"!

I feel really dumb, I've been trying to resolve this for about two hours now. What am I doing wrong?
 
What is the Join Type set to?

Find it by opening Relationships, Right click go to Edit Relationship, then press the Join Type button.



paveway [machinegun]

Looking for help check the FAQ's first then do a search then ask. Worked for me.
 
I have one relationship like yours and have it on type 2.


paveway [machinegun]

Looking for help check the FAQ's first then do a search then ask. Worked for me.
 
Since you're opening a table and clicking the "+" sign next to the row, you're talking about a subdatasheet.

You can control the information displayed in a subdatasheet by opening the table in Design View, then choosing View|Properties from the menu. Generally, if you leave the Subdatasheet Name set on [Auto], Access tries to pick another table to which this table is related.

You may have tried to expand the subdatasheet before you created the relationship between you tables in the Relationships window. That could have caused Access to get the right table but not the right Link Master Fields and Link Child Fields properties.

If you manually set these three properties (Subdatasheet Name, Link Master Fields, and Link Child Fields), you should be able to create the equivalent of a join between the tables.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Whoa! I just realized my post contained an accidental smiley. The word it replaced was "[auto]".

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top