Importing CSV using VBA and Saved Data Task RRS feed

  • Question

  • I've saved a data task named "Import-Report" which works fine when executed manually.  It imports f:\report.csv into a table named REPORTS.

    The following VBA code:

        DoCmd.TransferText acImportDelim, "Import-Report", "REPORTS", "f:\report.csv", True

    produces a Run-Time error '3625': The text file specification 'Import-Report' does not exist.  You cannot import, export, or link using the specification.

    Any idea why I'm getting this message?


    Friday, March 4, 2016 4:48 PM

All replies

  • This is because the saved import is not stored as a "normal" import-export specification. You can run the saved import from code with

    DoCmd.RunSavedImportExport "Import-Report"

    Matthias Kläy, Kläy Computing AG

    Saturday, March 5, 2016 12:33 PM