Results 1 to 3 of 3
  1. #1
    Mattbro is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2012
    Posts
    95

    Export specifications with DoCmd.OutputTo acOutputQuery

    Hello All,
    Using Access 2010, I have a query in a db that I regularly export. This produces a .txt file. Using the advanced option in the Export Text Wizard when exporting, I use the ‘specs’ box to use my predefined format that is saved in the list as ‘QueryExport Export Specification’.
    I would like to automate the process into an on_click event and have got as far as:
    Code:
     
    ‘DoCmd.OutputTo acOutputQuery, "QueryExport", "MS-DOSText(*.txt)", "C:\CP\Cextracts\QueryExport.txt", False, "", , acExportQualityPrint’
    Which is great, but of course, doesn’t bring the ‘specs’ into play. Could anyone tell me if it can be done, and if so, how?


    Many thanks,
    Mattbro

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    If you use TransferText instead of OutputTo, you can designate the Export Specs to use.

  3. #3
    Mattbro is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2012
    Posts
    95
    Yes!
    Code:
    DoCmd.TransferText acExportDelim, "QueryExport Export Specification", "QueryExport", " C:\CP\Cextracts \QueryExport.txt"
    Thanks a lot.
    M

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

Similar Threads

  1. Docmd.outputto Error
    By DaveWatson in forum Programming
    Replies: 5
    Last Post: 11-05-2012, 05:55 PM
  2. DoCmd.OutputTo question
    By mkc80 in forum Access
    Replies: 5
    Last Post: 10-16-2012, 07:11 PM
  3. DoCmd.OutputTo acOutputReport
    By GraeagleBill in forum Reports
    Replies: 11
    Last Post: 09-15-2012, 07:33 PM
  4. DoCmd.OutputTo
    By tylerg11 in forum Reports
    Replies: 2
    Last Post: 08-09-2012, 12:22 PM
  5. AcFormat in DoCmd.OutputTo
    By SIGMA248 in forum Programming
    Replies: 1
    Last Post: 04-15-2011, 08:50 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