Import Question

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, ""
 
K

Klatuu

What you are describing and what the code says don't agree. You are
explicitly deleteing both tables before you do the import, so that should not
happen.
 
H

HELP

This works based on having the tables already exsisting.

So currently the tables exsist. This code actually ended up working and
performing the function I wanted. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top