• relationship error (XP)

    Author
    Topic
    #435047

    Thnks for the last one Hans – you really are a fabulous help,
    I’m using the code to add a relationship –
    Set relRelationship = dbDatabase.CreateRelation(strRelationship, strTableOne, strTableMany, dbRelationUpdateCascade)

    relRelationship.Fields.Append relRelationship.CreateField(strFieldOne)
    relRelationship.Fields(strFieldOne).ForeignName = strFieldMany
    dbDatabase.Relations.Append relRelationship

    but I get an error “invlalid field definition in definition of index or relationship” I think there is a problem in the second last line but I can’t work it out.

    Viewing 0 reply threads
    Author
    Replies
    • #1027204

      I tried your code in my test database and it created a relationship without errors, so I suspect there is something wrong with the field name – are you sure strFieldOne has a correct value?

      • #1027206

        Found the Problem – I had not created the foreign key field – thanks, it aways helps when you know where not to look.

    Viewing 0 reply threads
    Reply To: relationship error (XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: