Show all foreign tables from a relation : Relationship « Access « VBA / Excel / Access / Word






Show all foreign tables from a relation

 
Sub ShowRelations()

    Dim db As Database
    Dim rel As Relation
    Dim strDetail As String
    
    Set db = CurrentDb()
    
    Debug.Print "Relationships:"
    Debug.Print
    For Each rel In db.Relations
        strDetail = rel.Table & " is related to " & rel.ForeignTable
        Debug.Print strDetail
    Next

End Sub

 








Related examples in the same category

1.Creating a One-to-Many Relationship
2.Create Relation