Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2004
    Posts
    5

    Question Unanswered: Transfer Text does not export correctly

    Hi All,

    Is there a way to keep the data from the table in the same order when it transfers to a *.txt file??

    I am trying to export a table with close to 3000 records, I have a column ID which is in incremental order from 1 to 3000. My problem is that when I use the command:

    DoCmd.TransferText acExportDelim, "FLATOUTPUT Export Specification", "FLATOUTPUTTXT", "C:\Conversion Tool\FLATOUTPUTTXT.txt", 0

    ACCESS transfers all the records but "SOMETIMES" it changes the order of a hundred or so records

    ID
    1
    2
    3
    2800
    2801
    2802
    4
    5
    6
    ...
    ...
    3000

    any information regardin this quanadrum is GREATLY appreciated in advance!!

  2. #2
    Join Date
    Sep 2003
    Posts
    228
    Under table properties, do you have anything in the Order By field?

  3. #3
    Join Date
    Sep 2004
    Location
    Charlotte, NC
    Posts
    164
    Unless that is something in newer versions of Access, I don't think there is an 'Order By' property for tables. One thing you may want to try because I've seen this mentioned before, is to set your ID field as a primary key. If you already have it set that way or if this doesn't correct the problem, you may want to consider creating a query with all of the fields that you want and have it sort on the ID and then export the query results to your text file.

    Good luck.

    TD

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Before exporting your table, try to sort it according to any alpha field which doesn't have numerics. i.e according to Name, City,.....

  5. #5
    Join Date
    Oct 2004
    Posts
    5
    tried it still no go, I do have the table already presorted and I have ID set as the primary key. When I view the table in ACCESS it's sorted correctly in ascending order by ID, and all the data is in the correct order... still having a misalignment after the conversion to text... and I appreciate all the help again

  6. #6
    Join Date
    Oct 2004
    Posts
    5
    SOLVED IT!!! again thank you all for the help..
    as for anyone else viewing this post.. the solution was that I DID HAVE ID as the PRIMARY KEY when the table was created... taking it out, and having the table order by ID solved it..

  7. #7
    Join Date
    May 2012
    Posts
    1

    Thumbs up Text does not export correctly

    Here is how I solved my sort order problem.

    Copied the table
    Paste "Structure Only"
    Created an Append Query

    Appended my original table with the correct sort.

Posting Permissions

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