weekly import a chore

  • Thread starter Thread starter BJM
  • Start date Start date
B

BJM

Each week I must import data from csv text files to five
tables in my databse in order to update their records.

Having to go through the process of Get(ting) External
Data....with all the wizard's steps, five times over is a
pain.

Is there any way I can write a macro/event that will
facilitate this chore?

The text files are always found on the same path relative
to the database, and the wizard options are always pretty
much default and remain the constant week to week. The
field names in both text value file and destination table
are alike...no mapping necessary.

Thanks,
BJM
 
BJM,

On the face of it, the trickiest bit will be that apparently the file
names of the external files will change from week to week, is that
right? Is there any predictable methodology to the naming?

Anyway, in the meantime, have a look at the TransferText macro action.

- Steve Schapel, Microsoft Access MVP
 
Thank you for your reply.

No! Actually, it's not tricky at all. I guess I overlooked
adding that to the list, but the dump text files' names
remain static as well.

Will take a look at the macro action.

BJM
 
In a code module, you can do this:

DoCmd.TransferText acImportDelim, "SAVED IMPORT SPEC NAME",
"DESTINATION TABLE NAME", "FILE NAME", BOOLEAN-FirstRowHasFieldNames
 
I have a very similar situation, and I've gotten the macro
to import the data. However, I need it to overwrite
existing data with changes. For example, a table contains
Company and BusUnit. If the Company stays the same but the
BusUnit changes, I want the old information deleted and the
new information appended. I'm stuck! Any help is
appreciated!!

Thanks!

Holly
 
Back
Top