Consulting

Results 1 to 3 of 3

Thread: TransferText Macro, is their a better way???

  1. #1

    TransferText Macro, is their a better way???

    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.
    "My common sense is tingling!" - Deadpool
    http://marveldcforum.com

  2. #2
    VBAX Contributor
    Joined
    Oct 2011
    Location
    Concord, California
    Posts
    101
    Location
    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.

  3. #3
    Thanks I will try that out!
    "My common sense is tingling!" - Deadpool
    http://marveldcforum.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •