DoCmd.TransferText VBA versus Wizard

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mariostg
    Contributor
    • Sep 2010
    • 332

    #1

    DoCmd.TransferText VBA versus Wizard

    I am having issues importing a space delimited file with DoCmd.TransferT ext.
    I created a specification name through File->Get External Data->Import.
    It all works fine when I import the file via the MS Access Import wizard and use the import specification name but when I replicate the same process through
    Code:
    DoCmd.TransferText acImportDelim, "202DailyListImportSpecification", "tmp_202", cleanfile, False
    that does not cooperate at all. The first 11 fields from the text file are imported in the first field of the table.
    In either case, I do the import in a newly created table.
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3665

    #2
    Mariostg,

    Have you found a solution to this yet? If you could post a sample of your text, that might help...

    Cheers,
    twinnyfo

    Comment

    • Mariostg
      Contributor
      • Sep 2010
      • 332

      #3
      Hi twinnyfo
      It has been so long, I had to go back to the code to see how I solved it.
      Each line of text was right padded with about 250 blank spaces. After I trimmed the lines, it worked ok. It's odd.

      Thanks anyway.

      Comment

      Working...