How do you delete and then recreate a relationship within code (command button). I'm having to import a dBASE file into access and the table is linked to another on a one-to-one basis. The original data table needs to be deleted and re-imported frequently but I can't delete it because of the relationship. I tried to just delete all of the data in the table and import into the existing table but from what I understand of the acImport command, it will create a new table if one of the same name exists (unless somebody can show me different). Here's the code:
DoCmd.TransferDatabase acImport, "dBASE III", "C:\", acTable, "NonConf", "NonConf"
When I run this it imports the NonConf table with fieldnames and data. If I run it again I get another NonConf table but it is called NonConf1. If I can delete the relationship of one of the fields prior to deleting the table and then recreate it after the import my problem will be solved.
Many thanks in advance,
Bruce
DoCmd.TransferDatabase acImport, "dBASE III", "C:\", acTable, "NonConf", "NonConf"
When I run this it imports the NonConf table with fieldnames and data. If I run it again I get another NonConf table but it is called NonConf1. If I can delete the relationship of one of the fields prior to deleting the table and then recreate it after the import my problem will be solved.
Many thanks in advance,
Bruce