Relationship lines Access - SQL server

Gaztry80

Member
Local time
Today, 16:00
Joined
Aug 13, 2022
Messages
62
Good morning :)!

When I create a relationship in SQL server and add them in my Access database, Access sometimes does not auto recognize the relationship.
I try to understand why this is happening. I have tried to restart sql server and relink/fresh the linked tables in access after creating the relationship. However, when I make a new query and drag the tables into the design view, i still need to link the primary keys for both tables manually. Does anybody knows what this is causing or is there a little trick to refresh?

Table1:
- CompanyID (PK)
- CompanyName

Table2:
- CompanyID (PK)
- Address

I can off course do the linking by myself, but I want to understand why some tables link automatically and some don't.
Thank you for helping!

Br.
 
why does your 2 table has same PK on CompanyID?
if table2 is dependent to Table1, then you need
to make the CompanyID on this table as FK.
 
why does your 2 table has same PK on CompanyID?
if table2 is dependent to Table1, then you need
to make the CompanyID on this table as FK.
Thanks! I have deleted the PK on table 2, I thought that CompanyID in table2 also needed the status primary key.
Since it is the unique identifier of Table2. When I make it a foreign key, access recognizes the relationship.
 

Users who are viewing this thread

Back
Top Bottom