Relationship not shown on the screen
I have a function for creating one- to- many relationship between the tables customers and orders.The function seems to work OK,however the relationship does not appear on the screen.If i set it manually,i.e. If i choose the wizard,and select the two tables,then the tables
are automatically linked .Hence i conclude that the function works
properly,but i need of some refreshing action to bring out the
relationship on the screen.Is it so and can somebody help me?
My function is the following:
Public Function LinkCallsCustomers()
With dbs
Set tdf1 = .TableDefs!customers
Set tdf2 = .TableDefs!CallsCustomers
Set rel = .CreateRelation("CustomerIDRelationship", tdf1.Name, tdf2.Name, dbRelationUpdateCascade)
rel.Fields.Append rel.CreateField("CustomerID"
rel.Fields!Customerid.ForeignName = "CustomerID"
.Relations.Append rel
.Close
End With
End Function
I have a function for creating one- to- many relationship between the tables customers and orders.The function seems to work OK,however the relationship does not appear on the screen.If i set it manually,i.e. If i choose the wizard,and select the two tables,then the tables
are automatically linked .Hence i conclude that the function works
properly,but i need of some refreshing action to bring out the
relationship on the screen.Is it so and can somebody help me?
My function is the following:
Public Function LinkCallsCustomers()
With dbs
Set tdf1 = .TableDefs!customers
Set tdf2 = .TableDefs!CallsCustomers
Set rel = .CreateRelation("CustomerIDRelationship", tdf1.Name, tdf2.Name, dbRelationUpdateCascade)
rel.Fields.Append rel.CreateField("CustomerID"
rel.Fields!Customerid.ForeignName = "CustomerID"
.Relations.Append rel
.Close
End With
End Function