Query joins and Table relationships (1 Viewer)

Hisoka

New member
Local time
Today, 16:31
Joined
Sep 20, 2023
Messages
17
When I created a query, the program by default created a relationship between my two tables In Query DesignView,
But when I opened the relationships from Database Tools > Relationships, I did not actually find this relationship and it does not exist in the tables either.
When I delete this relationship from the query DesignView, the program duplicates the data.
Why does the relationship appear in queries? Is it called an actual relationship or is it just for creating the query according to the user’s request or something Else?

Thanks for any tips and guidance
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:31
Joined
Feb 19, 2002
Messages
43,275
But when I opened the relationships from Database Tools > Relationships, I did not actually find this relationship and it does not exist in the tables either.
You won't necessarily see relationships if you open the Relationship diagram in the FE. What you see in the query is a Join, not a relationship. A relationship is physical and is enforced by checking the enforce RI box. Therefore, relationships can only be defined in a database between physical objects. You cannot define relationships in the FE on linked tables because the tables don't actually exist in the FE. They exist in the BE and the FE only links to them. You can draw join lines to remind yourself of the connections but they don't actually do anything.

Access likes to be helpful. Therefore, if there is a relationship in the BE, whether you can see it or not in the FE, Access will usually draw the join line for you and it will look like the relationship line. Access also sometimes helps by drawing join lines between columns with identical names.
 

isladogs

MVP / VIP
Local time
Today, 16:31
Joined
Jan 14, 2017
Messages
18,227
For additional information on this topic see
 
Last edited:

Users who are viewing this thread

Top Bottom