Thread: Relationship attributes
08-07-03, 12:42 #1Registered User
- Join Date
- Jan 2003
- Aberdeen, Scotland, UK
Unanswered: Relationship attributes
Is it possible to find the relationship type of two tables. I can find if there is a relationship; but when I try to find if it's a left join or right join (by using the .Attributes) it just gives me an integer that, as far as I can see, means nothing.
Below is the code that I've got so far. Any help would be much appreciated.
Dim Rel As Relation
Dim Db As Database
Set Db = CurrentDb()
'Study the relationships
For Each Rel In Db.Relations
'See if there's any relationship
If Rel.Table = strTable1 And Rel.ForeignTable = strTable2 Then
MsgBox Rel.Name & " = " & Rel.Attributes
Thanks in Advance.
08-07-03, 13:14 #2Village Idiot
- Join Date
- Jul 2003
Here's what the returned integers mean
1 = The relationship is one-to-one.
2 = The relationship isn't enforced (no referential integrity).
4 = The relationship exists in a non-current database that contains the two linked tables.
256 = Updates will cascade.
4096 = Deletions will cascade.
16777216 = LEFT JOIN
33554432 =Right Join
The values can be combined if more than one condition is met.
A returned value of 257 mean 1 to 1, cascade update.
See the VBA help file for the Relation Object Summary. Look under Attributes.Inspiration Through Fermentation