I've had some behavior in MS Access 2019 that surprised me and I've boiled it down to the following:
I've got two tables with a different number of records:
I need to establish an outer join between them that includes all records from table [test 1] and only those records of [test 2] where the joined fields are equal, and I'd like to have referential integrity so that I can't accidentally delete or modify a joined field on one side only.
When I open the Relationships window with the two tables and drag field [ID] from table [test 1] to [test 2], the join properties I need appear as choice 2:
When I attempt to create the join, I get an error message saying that data in table [test 2] violates referential integrity:
However, if I define the join in the opposite direction by dragging field [ID] from table [test 2] to [test 1], the result is different. First, the join properties I need appear as choice 3:
I've seen that difference before, and it's no problem. But the surprise is that when I attempt to create the join, now it works:
So my ability to establish referential integrity appears to depend on which direction I drag the field to set up the join. (Does that make the join left vs. right?) I don't remember seeing anything before about directional dependence (or perhaps it could be called non-commutativity) of referential integrity. The purpose of referential integrity is to prevent me from deleting or modifying a joined field in one table without making the corresponding change in the other. How does that objective depend on which direction I drag the field to set up the join?