PDA

View Full Version : TransferText Macro, is their a better way???



bobdole22
09-06-2013, 12:58 PM
I am trying to automate this procedure. It imports a .csv file by clicking the "External Data" tab => "Text File." That part works, but is not automated. The only way I've seen to automate it is by selecting "TransferText" under the macro section and filling out the necessary info.

This way has been working terribly. It has become very inconsistent, rarely ever working. Seems to have problems overwriting an old file, and I'd rather use a variable as the filepath if possible. Is their any VBA code I can use to attempt to perform this? TransferText is not helping much at all.

mrojas
09-10-2013, 05:06 PM
I've successfully imported text files using the following syntax:
DoCmd.TransferText acImportDelim, , strImportInto, strImportFrom

The last two parameters are variables specifying the destination table and the source file name, including path.

bobdole22
09-12-2013, 06:57 AM
Thanks I will try that out!