I have a database which is defined in a MIL standard. This consists of 104 tables and has a key that consists every time of three fields at minimum. I do not want to have all relations in the database because of stability reasons. Secondly, the data is delivered in a single DAT file and has to be spread over the tables through an import. I want to load the data and then run code to check on duplicates and orphan records, so it will not be during the import.
However, it would make life much easier if I can establish the relationships at runtime only for those tables that I need and remove them afterwards. I have found the CreateRelationships for DAO, but this is only for one key field. It is possible to create a relationship with multiple keyfields manually via the drop down menu.
Does anybody know what to run in VBA to create a relationship on multiple fields?
E.g.
Table: Master
Fields: Fld1, Fld2 and Fld3
Table: Slave
Fields: Fld1, Fld2 and Fld504
Create relationship between tables Master and Slave on fields Fld1 and Fld2