Results 1 to 3 of 3
  1. #1
    rdougherty is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Dec 2016
    Location
    Michigan
    Posts
    91

    TransferText command for saved import steps... why not working?

    Hello,



    I am hoping to automate a few imports for a database in order to remove manual steps.

    I have used this process before, but for some reason, it is not working in this database:

    Code:
    Public Sub Import()
    
    Const ImpSPec1 = "Received"
    
    
        DoCmd.TransferText acImportDelim, ImpSPec1, "tbl_Received", "\\redacted\corp\shared\redacted\Forecast_Reporting\raw_data\redacted\Received.csv", False
        
    Exit Sub
    End Sub
    Even though I have a saved import for .csv which tests successfully on its own, named "Received", this code provides the error that: "The text file specification "Received" does not exist." And "received" is spelled correctly in all places, btw :P

    Do you see any issues with what I"m doing?

  2. #2
    rdougherty is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Dec 2016
    Location
    Michigan
    Posts
    91
    NVM, I think this is "solved", since I just discovered that https://msdn.microsoft.com/en-us/vba...-method-access suggests that we use RunsavedImportExport method instead.

  3. #3
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Strange.

    Don't see anything wrong with the command.

    This is what I have been using for more than 10 years without any problems:
    Code:
    DoCmd.TransferText acImportDelim, "HoursImportSpecification", "tblHoursImport", strFileName, True
    The variable "strFileName" is the drive, path and filename from a file dialog file picker. The files are CSV files.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 08-09-2017, 04:46 AM
  2. docmd.TransferText WITHOUT Import spec?
    By markcrobinson in forum Access
    Replies: 1
    Last Post: 08-07-2017, 03:37 PM
  3. Need to Edit Saved Import
    By deekadelic in forum Import/Export Data
    Replies: 2
    Last Post: 07-22-2016, 01:23 PM
  4. partial import with transfertext
    By hklein in forum Programming
    Replies: 2
    Last Post: 04-20-2012, 04:15 AM
  5. use vbs and TransferText cmd to import csv
    By conway in forum Import/Export Data
    Replies: 1
    Last Post: 02-03-2012, 08:38 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums