Results 1 to 4 of 4

Export "Query or Report" to a "Delimited Text File"

  1. #1
    hawzmolly is offline Advanced Beginner
    Windows 7 Access 2010 32bit
    Join Date
    Oct 2008
    Location
    Green Bay, WI
    Posts
    77

    Export "Query or Report" to a "Delimited Text File"


    A little background. I need to export the results of a query I use to build a report. For Print Master software I need the "Field Names" in the text file as well as the data for a Mail Merge in Print Master (PM).

    The PM error: "The field name information in the file you have specified is missing or not correctly formatted. The first line of the file must contain the database field names. Make sure the "Export Field Names" (or similar) option is selected in the program from which you are exporting data."

    Trouble is, when trying to export the report or query, Access has no "Export Field Names" option. It works if I first export to Excel and then from Excel to "txt" then to Printmaster. I would like to eliminate the Excel step. Therefore, how do or can I get Access Export to transfer the "Field Names" along with the field data?

  2. #2
    JoeM is online now VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,849
    Take a look at the TransferText action under Macros. You can choose to Export a Delimited Text File. Pay special attention to the "Has Field Names" argument. If you choose "Yes", it will export your Field Names.

    BTW, I recommend trying to export the query, not the report.
    Using Access 2007
    Proficient in Access, Excel, VBA, and SQL

  3. #3
    hawzmolly is offline Advanced Beginner
    Windows 7 Access 2010 32bit
    Join Date
    Oct 2008
    Location
    Green Bay, WI
    Posts
    77
    I found that one has to go to "ImportExportText" in Access 2010. However, when you click on this to add it to the macro I get "Unsafe Action". I have "Enable all macros" checked as well as I have added the location to "Trusted Locations". This MS security is BS. I am the one to decide my risk not MicroSoft. Anyway, how do I get past the "Unsafe Action"? Yes, I will use the query and not the report method.

    TIA

  4. #4
    JoeM is online now VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,849
    Note that you want to use the TransferText option. In Access 2007 and Access 2010, this option is often hidden. You just need to click on the "Show All Actions" button from the Show/Hide menu/ribbon in order to see it.
    Using Access 2007
    Proficient in Access, Excel, VBA, and SQL

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

Similar Threads

  1. Replies: 1
    Last Post: 08-23-2012, 08:32 AM
  2. Replies: 11
    Last Post: 03-29-2012, 02:32 PM
  3. Replies: 16
    Last Post: 07-22-2011, 09:23 AM
  4. "Group By" causes "ODBC--Call Failed" error
    By kaledev in forum Queries
    Replies: 1
    Last Post: 03-09-2011, 02:43 PM
  5. File Export "sort" issues
    By jgelpi16 in forum Programming
    Replies: 24
    Last Post: 09-15-2010, 12:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums