H
HELP
I am trying to import two files. When I run the module I would like to delete
the tables if they exsist and import a fresh table. Currently with the code
below once the module is run multiple times, it just adds to the table. So
the first time it runs the values are correct in the table. However, once run
a second time the values double. What would be the appropriate code to import
files and if the tables already exsist delete and import the fresh table?
DoCmd.DeleteObject acTable, "Inv"
DoCmd.DeleteObject acTable, "Invc"
DoCmd.TransferSpreadsheet acImport, 8, "Invc",
"P:\IS\EndOfMonthPackage\2006-09\ShipmentsDetail-Monthly-Sept2006", True, ""
DoCmd.TransferSpreadsheet acImport, 8, "Inv",
"P:\IS\EndOfMonthPackage\2006-09\InventoryDetail-Sept2006", True, ""
the tables if they exsist and import a fresh table. Currently with the code
below once the module is run multiple times, it just adds to the table. So
the first time it runs the values are correct in the table. However, once run
a second time the values double. What would be the appropriate code to import
files and if the tables already exsist delete and import the fresh table?
DoCmd.DeleteObject acTable, "Inv"
DoCmd.DeleteObject acTable, "Invc"
DoCmd.TransferSpreadsheet acImport, 8, "Invc",
"P:\IS\EndOfMonthPackage\2006-09\ShipmentsDetail-Monthly-Sept2006", True, ""
DoCmd.TransferSpreadsheet acImport, 8, "Inv",
"P:\IS\EndOfMonthPackage\2006-09\InventoryDetail-Sept2006", True, ""