Here's some code you can tinker with. I've found that deleting relationships from the Relationship window does not permanently delete them.
Private Function CreateRelationships()
'create relations between tbP(ni) & tbComments
Dim db As DAO.Database
Dim rel As DAO.Relation
Dim fld As DAO.Field
Dim tbl As TableDef
Dim sRelname As String
Set db = CurrentDb
For Each tbl In db.TableDefs
If left(tbl.Name, 3) = "tbP" Then
Debug.Print tbl.Name
Set rel = db.CreateRelation(tbl.Name & "tbComments", tbl.Name, "tbComments")
rel.Attributes = dbRelationDeleteCascade
Set fld = rel.CreateField("PropID")
fld.ForeignName = "PropID"
rel.Fields.Append fld
db.Relations.Append rel
End If
Next
End Function
Private Function DeleteAllRelationships() As Variant
Dim db As DAO.Database
Dim rel As DAO.Relation
Set db = CurrentDb
For Each rel In db.Relations
With db.Relations
.Delete rel.Name
End With
Next
End Function