I want to import data from three DBF files into three existing tables in my database. Following a suggestion from another forum user, I am using the following code, where tblA, tblB, and tblC are my tables and DBF-A, DBF-B, and DBF-C are my three DBF files.
CurrentDb.Execute "DELETE * FROM tblA"
DoCmd.TransferDatabase acImport, "dBase IV", "C:\Databases", acTable, "DBF-A", "tblA", False
CurrentDb.Execute "DELETE * FROM tblB"
DoCmd.TransferDatabase acImport, "dBase IV", "C:\Databases", acTable, "DBF-B", "tblB", False
CurrentDb.Execute "DELETE * FROM tblC"
DoCmd.TransferDatabase acImport, "dBase IV", "C:\Databases", acTable, "DBF-C", "tblC", False
Instead of writing the new data to the tblA, tblB, and tblC tables, Access creates 3 new tables:tblA1, tblB1, and tblC1.
I can't figure out why it is creating new tables when I am clearly asking it to import the data into the existing tables.
Anyone know what's going on here?
Duluter
CurrentDb.Execute "DELETE * FROM tblA"
DoCmd.TransferDatabase acImport, "dBase IV", "C:\Databases", acTable, "DBF-A", "tblA", False
CurrentDb.Execute "DELETE * FROM tblB"
DoCmd.TransferDatabase acImport, "dBase IV", "C:\Databases", acTable, "DBF-B", "tblB", False
CurrentDb.Execute "DELETE * FROM tblC"
DoCmd.TransferDatabase acImport, "dBase IV", "C:\Databases", acTable, "DBF-C", "tblC", False
Instead of writing the new data to the tblA, tblB, and tblC tables, Access creates 3 new tables:tblA1, tblB1, and tblC1.
I can't figure out why it is creating new tables when I am clearly asking it to import the data into the existing tables.
Anyone know what's going on here?
Duluter