Table of contents
Collapse the table of content
Expand the table of content

Cannot append a relation with no fields defined. (Error 3366)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Applies to: Access 2013 | Access 2016

You are trying to append a Relation object to a Relations collection, but the Relation object has no fields.

To correctly append a Relation

  1. Use the CreateRelation method to create the Relation object. Set the Table, ForeignTable, and Attributes properties of the Relation object, if you did not specify them as arguments to the CreateRelation method. Use the CreateField method to create a new Field object for each field in the primary and foreign keys of the relationship.

  2. Set the Name (if you did not specify it as an argument to the CreateField method) and ForeignName properties of the Field object or objects to the corresponding Name property settings of the primary key and the foreign key Field objects of each field in the relationship.

  3. Use the Append method to save the Field object or objects in the Fields collection of the Relation object.

  4. Use the Append method to save the Relation object in the Relations collection of the database.

Access for developers forum on MSDN
Access help on
Access help on
Search for specific Access error codes on Bing
Access forums on UtterAccess
Access wiki on UtterAcess
Access developer and VBA programming help center (FMS)
Access posts on StackOverflow

© 2018 Microsoft