Results 1 to 6 of 6
  1. #1
    Benj is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    May 2018
    Posts
    33

    export to text tab delimited


    am new to access. am going to export a query to a note pad (text file). it works but the result shows the heading which i dont want and it uses "," as a delimiter. i just want to have clean tabs and no characters. thanks!

    DoCmd.TransferText acExportDelim, , "1Farrow", "C:\Users\User\Documents\pigknows\FARROW.txt", True

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    I am thinking TransferText only uses comma separated.

    However, can use the Specification argument to get around that limitation. Do a manual export and SaveSpecification. Then reference that saved specification in the TransferText method.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    it works but the result shows the heading which i dont want
    - change your true to false

  4. #4
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You MUST use an Export Specification to change the commas to TABs.
    Look for the sub header Export Access Query to TXT using DoCmd.TransferText Method

    The command would look like
    Code:
     syntax        '    TransferType, SpecificationName, TableName,                                      FileName, HasFieldNames
    Docmd.TransferText acExportDelim, "ExportTabDelim" , "1Farrow", "C:\Users\User\Documents\pigknows\FARROW.txt", False
    You must do one export manually, so you can create the export spec and save it. (Remember the export name!!)


    Edit-- I should have read slower - missed June's full response...

  5. #5
    Benj is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    May 2018
    Posts
    33
    So this is what I did (1) Export 1FARROW as text file (2) click OK without ticking any boxes (3) click NEXT again as DELIMITED is ok (4) chose TAB as delimiter and NONE as text qualifier (5) FINISH export to file C:\Users\User\Documents\pigknows\1FARROW.txt (6) tick SAVE EXPORT STEPS and save as KFARROW then SAVE EXPORT.... from here, i opened the text file and it uses tab (none) as delimiter. my code is

    DoCmd.TransferText acExportDelim, "KFARROW", "1FARROW", "C:\Users\User\Documents\pigknows\1FARROW.txt" , False
    but gives me a RUN TIME ERROR 3625 so I removed quotations for specification name

    DoCmd.TransferText acExportDelim, KFARROW, "1FARROW", "C:\Users\User\Documents\pigknows\1FARROW.txt" , False
    but gives me this text file:

    "1042y","5-11-2018","FARROW",8,1,,"","","","","f4","",,"","","", "","","","","",""
    "1228w","5-3-2018","FARROW",11,1,,"","","","","r2","",,"","","" ,"","","","","",""

    am really stuck... help would be greatly appreciated. thanks in advance!

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    1. the specification is a string - so I'm surprised it worked without it being a string unless you dimmed it somewhere
    2. the steps you have detailed does not show you saved the specification - you need to go to the advanced tab and save it there

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

Similar Threads

  1. text tab delimited
    By Benj in forum Import/Export Data
    Replies: 8
    Last Post: 05-18-2018, 06:02 PM
  2. Replies: 6
    Last Post: 03-27-2017, 10:39 AM
  3. Replies: 7
    Last Post: 01-08-2014, 10:36 AM
  4. How do you Delimited Text?
    By smc678 in forum Access
    Replies: 3
    Last Post: 12-24-2012, 12:06 AM
  5. Export "Query or Report" to a "Delimited Text File"
    By hawzmolly in forum Import/Export Data
    Replies: 3
    Last Post: 08-31-2012, 08:00 AM

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