ACCESS VBA - DAO in VB - problem with creating relations
- by Justin
So take the following example:
Sub CreateRelation()
Dim db As Database
Dim rel As Relation
Dim fld As Field
Set db = CurrentDb
Set rel = db.CreateRelation("OrderID", "Orders", "Products")
'refrential integrity
rel.Attributes = dbRelationUpdateCascade
'specify the key in the referenced table
Set fld = rel.CreateField("OrderID")
fld.ForeignName…