UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Which Click First?, Access 2016    
 
   
ntambomvu
post Apr 9 2020, 08:17 AM
Post#1



Posts: 57
Joined: 20-November 16



one question
when creating the link between table relationships is it important which side of the relationship is clicked first
in other words
creating a link between partid and vehicleid does it matter if I click first on partid and drag to vehicleid or if I click
first on vehicleid and drag to partid
regards
Fred
Go to the top of the page
 
GroverParkGeorge
post Apr 9 2020, 08:33 AM
Post#2


UA Admin
Posts: 37,265
Joined: 20-June 02
From: Newcastle, WA


No. You are working with a graphical representation of the underlying relationships, which are defined by the constraints placed on the fields in each table.

As long as the data types are correct, and the two fields chosen are actually a Primary and a Foreign Key, the line drawing part is not critical.

--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
GroverParkGeorge
post Apr 9 2020, 08:35 AM
Post#3


UA Admin
Posts: 37,265
Joined: 20-June 02
From: Newcastle, WA


I am assuming, of course, that you're talking about defining Referential Integrity, which is the only reason you'd bother to do this in the relationship window in the first place. Simply "drawing join lines" is not really useful unless you go on to establish the Referential Integrity involved.

--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
ntambomvu
post Apr 9 2020, 09:09 AM
Post#4



Posts: 57
Joined: 20-November 16



Thank you Grover,
Does this mean that when the relationship is created - Acccess will automatically know which is the foreign key and which is the
primary key?
Go to the top of the page
 
GroverParkGeorge
post Apr 9 2020, 09:17 AM
Post#5


UA Admin
Posts: 37,265
Joined: 20-June 02
From: Newcastle, WA


Well, yes and no.

Primary Keys are DEFINED by the person who created the table, so Access "knows" that.

Foreign Keys are DEFINED by the process of establishing Referential Integrity, so, again, Access "knows" that when you finish the process:

Attached File  RI.jpg ( 77.15K )Number of downloads: 2


Note that the Primary Key in tblCompany is identified as such by the little "Key" icon.

The "Edit Relationships" property sheet has the checkbox to Enforce Referential Integrity on the relationship. If you don't do that, there is NO relationship established. That's an important thing to understand. Simply drawing the line between fields is meaningless by itself.

George

--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    30th May 2020 - 11:05 AM