Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relationship not shown on the screen

Status
Not open for further replies.

primerov

Technical User
Aug 16, 2002
160
BG
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
 
Ho primerov,

If you are talking about the Relationships Window, if you create a Relationship this way, to view it, while in the Relationships Window from the menu select Relationships >> Sow All. The tables should be there because your code is 100% spot on.

Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top