I have a couple of mdb files with the exact table structure. I have to change the primary key of the main table from autonumber to number in all of them, which means I have
Thanks for code snippet. to get rid of your 3284 error I have changed a few things. If you copy all indexes from sample mdb and then try to put relationships it throws an exception as it expects no idexes for relationshisps when you put relationships it puts its own indexes. Steps I followed are (assume target.mdb and source.mdb):
target.mdb by calling ChangeTablesAddIndexesFromBU source.mdb and use conditionndxBU.Unique Then tdf.Indexes.Append ndx End If this willput just Unique indexsource.mdb and put all relationsshipsndxBU.Unique ThenI have also added error trap same as AddRelationsFromBU in AddIndexesFromBU and resume next for if ans else
This worked for me.