Results 1 to 10 of 10

Export query to text doesn't work

  1. #1
    tobbe is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2018
    Posts
    6

    Export query to text doesn't work

    Hi



    I'm trying to export a query to text but it doesn't work.


    Click image for larger version. 

Name:	export.png 
Views:	9 
Size:	6.0 KB 
ID:	36177

    I've created the file but it doesn't matter.

    If i use "Export data with formatting and layout" it exports just fine, but i only want the unformatted file.

    Using Access 2016

  2. #2
    Minty is offline Hacker
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    1,079
    You physically can't have a query called Query1.txt , Access won't allow you to have a period (.) in a query name.

    How are you trying to run the export? From code or a macro presumably - can you show us that please?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    tobbe is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2018
    Posts
    6
    The query isn't named Query1.txt, thats the name of the output file.

    The query is called Query1

    I do a right click>export>Text file

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    7,391
    text exports MUST have a SPECIFICATION name to make sure the data is delimited, etc.

    For network files, try to you full UNC drive names and not drive letters...some users wont have that drive letter: "\\server\folder\file.txt"
    local drives do use letters:

    docmd.TransferText acExportDelim ,"specName","query","c:\file.txt",true

  5. #5
    tobbe is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2018
    Posts
    6
    I have a specification and the file is to be saved locally. And it still doesn't work

  6. #6
    Minty is offline Hacker
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    1,079
    Please tell us how you are trying to do this - from the menu or via code? If it's code or macro please show the code.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  7. #7
    tobbe is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2018
    Posts
    6
    From the menu

  8. #8
    Minty is offline Hacker
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    1,079
    Okay - it appears to be query dependent, one query with parameters won't export without selecting the "Export data with formatting and layout" option.
    Another does - but it doesn't have any parameters, maybe that's the issue ?

    If your query has parameters try hard coding them and see if that fixes it.

    I'm using 2016.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  9. #9
    tobbe is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2018
    Posts
    6
    Perfect! I will try that!

  10. #10
    tobbe is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2018
    Posts
    6
    I don't have any parameters

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

Similar Threads

  1. Replies: 5
    Last Post: 06-09-2015, 07:45 PM
  2. Open Query doesn't work
    By jj1 in forum Access
    Replies: 3
    Last Post: 02-04-2015, 12:01 PM
  3. My query code doesn't work
    By blacksaibot in forum Programming
    Replies: 2
    Last Post: 03-08-2012, 01:59 PM
  4. Replies: 4
    Last Post: 07-25-2011, 11:33 PM
  5. Query doesn't work the day after
    By sithis876 in forum Queries
    Replies: 1
    Last Post: 07-13-2010, 06:11 AM

Tags for this Thread

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