Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Relationship not shown on the screen (Access 2000)

    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

  2. #2
    3 Star Lounger
    Join Date
    May 2002
    Location
    Toronto, Ontario, Canada
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Relationship not shown on the screen (Access 2000)

    When you say that you can't see it on the screen, are you talking about looking at the relationships window?

    I'm using Access 97 and I've never needed to create relationships in code before, but I just looked it up in help and there is a Refresh method for the Relations collection... Have you tried using that after you append "rel" to the Relations Collection?

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Relationship not shown on the screen (Access 2000)

    Have you tried Relationships | Show All (while the Relationships window is open?)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •