Results 1 to 1 of 1
  1. #1
    Join Date
    Nov 2003

    Unanswered: Newbie TransferText problem

    I am trying to automate importng a .txt file into an existing table. Here is what I have so far:

    Function GetTaxes()

    Dim FileName As String, TblName As String

    FileName = "C:\Tax1.txt"
    TblName = "Tax1"

    DoCmd.TransferText acImportDelim, , TblName, FileName

    End Function

    The reason I am using variables for the name is they will eventually be dynamic, but Ineed to get the command correct first. It seems to start, but I get the error message:

    "Field 'F1' does not exist in destination table 'Tax1'" There are no field names in the file (I believe that is the default argument, but even if I explicitly tell it there are now field names, I get this message. What am I doing wrong?

    Is there a better method for doing this than using DoCmd.TransferText?
    Last edited by cdols; 12-16-04 at 17:39. Reason: Typo

Posting Permissions

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