Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Location
    Aberdeen, Scotland, UK
    Posts
    168

    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
    End If
    Next Rel

    Thanks in Advance.

    John

  2. #2
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •