We help IT Professionals succeed at work.

Access Relationships

James Coats
James Coats asked
on
I am teaching myself table relationships and I am having some problems. I feel I need a linking table between the tables I have made but have tried several ways of using the linking table with no success thus far.

I have tree tables: Deals, Organizations, Lawyers and Links.

Each organizaion is represented by one lawyer. I can't seem to make a one-to-one and keep referential integrity.
Each organization can have many different deals with other organizations with different lawyers.

In the deals table something funny is going on in that it seems to be linked to itself and it should link to Organizations.

Any help on this would be much appreciated.
AttorneyDB2.accdb
Comment
Watch Question

Infotrakker Software
Most Valuable Expert 2012
Top Expert 2014
Commented:
If an Organization can be associated with multiple Deals, then you need a Join table between your Organization table and your Deal table:

tblOrganization_Deal
------------------------------
ID
OrganizationID
DealID

From there, an Organization can be associated with multiple Deals, and Deals can be associated with multiple Organizations.

I'm also curious regarding the tblDeals.fldLawyerID. Is a single Lawyer associated with a Deal? Or can there be multiples?

Also, do yourself a favor and stop setting lookups in Table Design. For example, tblOrganization.fldLawyerID is a combo. It should not be. It should be a simple Numeric field, with the "Lookup" set to "Textbox". After creating a form based on that table, if you then would like a List or Combo, create that control on the Form.

A bit more information:

A Table should define a specific "entity" in your real-world need. In your example, you have Organizations, Lawyers and Deals. Your Organization table should have attributes about an Organization ONLY - for example, you would not store the LawyerName in that table, but rather a link to the Lawyer associated with the Organization. The Lawyers table should store information about the Lawyer only - for example, Name, FirmName, DateOfBirth, etc. It would not store information about the Deal, and would not necessarily store a link to the Deal table (since, presumably, a single Lawyer could be associated with more than one Deal).
James CoatsComputer Info. Sys. Student

Author

Commented:
Scott,

Thank you for the suggestions. I will work a new db on them. As to your question a lawyer can only be associated with one deal.

I am just working on developing skills in linking tables. I know in real life more than one lawyer would be associated with the same deal. This just to force the issue of making a specific type of link.

If you have no other suggestions. I will start the new db and award you the points.


Sam
James CoatsComputer Info. Sys. Student

Author

Commented:
Thanks Scott,

I will have to finish up tomorrow. This will be very helpful to me.

Sam