View Full Version : Transfer Text not working


dheich4321
05-22-2008, 05:27 AM
I have a transfer text module that does the following
Function AddressTable()
DoCmd.OpenQuery "Delete AddressSkip Table", acViewNormal, acEdit

DoCmd.TransferText acImportDelim, "AddressSkip Import Specification", "AddressSkip", "C:\pmclabel\addressskip.txt", True, ""

End Function

It deletes the data in the table then imports the records.
If I do the process manually. File->Import Data> Advanced- use the AddressSkip Import Specification. into an existing table. It imports the data correctly.

When I use the module, it imports the 1st field and nothing more.

Any suggestions?

namliam
05-22-2008, 05:33 AM
why are you opening the query first? Either run it after the import or not at alll, this is just a waste.

Are you sure you have a delimited file? Or is it a fixed file?
Mixing a Delimited parameter (acImportDelim) with a seperated file, will give results like this. (or vice versa ofcourse)

While I am here, DONT use any spaces in any names anywhere any time....
Naming convention! Get a naming convention going where i.e. all queries are prefixed with qry and tables by tbl.

dheich4321
05-22-2008, 09:54 AM
It was delimited vs fixed. Thanks for the knowledge. The reason I am running the delete query is to clear the table, prior to loading the new detail.

Thanks again

namliam
05-22-2008, 11:36 PM
Ah, yes, delete query... *DUH*

Delimited vs Seperated, I still run into that error myself sometimes... Typical *slap yourself on the head*-error