Results 1 to 3 of 3
  1. #1
    MissAran is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jan 2014
    Posts
    6

    Exporting A Query containing a SWITCH function - unable....

    Hi There,



    I have a Marco that outputs a CSV file. This Marco previously used a standard query. However, the client requested that depending on a result the column's value will be x, or, y etc etc.

    So, I have the new query that contains a SWITCH function. The query runs fine via the "run" feature on Access and throughout the database.... except when I try to use the Marco to export. It always states:

    "The Microsoft Office Access database engine could not find the object 'invoices.csv'. Make sure the object exists and that you spell its name and path name correctly."

    Even though, if I take out the SWITCH function from the query it all works as expected.

    So my question is, could someone please test this out for me that you can export to a csv file using a marco with using a switch function.

    I just need to explain to the client that this can not happen... but a possible solution would also be fantastic!

    Any help would be much appreciated.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,616
    Works for me using VBA.

    Docmd.TransferText acExportDelim, ,"Query1", "C:\Temp\Test1.csv"
    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
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    convert the macro to vba and post that,
    also post the sql view of your query...

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

Similar Threads

  1. Unable to get Switch working correctly
    By Seeletse in forum Forms
    Replies: 13
    Last Post: 12-12-2012, 04:08 AM
  2. count and switch function in same select query
    By sandlucky in forum Queries
    Replies: 2
    Last Post: 04-08-2011, 11:16 PM
  3. Using SQL switch function MS Access
    By sandlucky in forum Queries
    Replies: 18
    Last Post: 03-31-2011, 08:49 AM
  4. Select Query in Switch Function
    By sandlucky in forum Queries
    Replies: 0
    Last Post: 03-30-2011, 04:54 AM
  5. Switch function query to combine tables
    By sandlucky in forum Queries
    Replies: 2
    Last Post: 03-29-2011, 09:46 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
  •  
Other Forums: Microsoft Office Forums