Results 1 to 7 of 7
  1. #1
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38

    Unhappy exporting query to text comma separated

    HI,

    New to this thread, like to know how do I make a macro or automate the exporting to export my query to .txt ( comma separate) with a macro or any other way? when I export this file the file is pipeline delimited not text comma separated. I am using the macro builder in access 2010. I have attached the screen shot. Appreciate any help.


    Thanks.
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,913
    The only ways I know use VBA. One of them:

    DoCmd.TransferText acExportDelim, , "tablename", "Drive\folderpath\filename.txt"

    Unfortunately, it also includes quote marks around text data.
    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
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38
    June 7 ,

    Cool!! that did it!!! OMG .. thnx so much!!! one more thing how do I call this vba code to my macro?
    Thanks!

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,913
    I don't use macros but I think they can call VBA code only if it is a custom function in a general module. Normally, I would put the VBA code behind a form, possibly the click event procedure of a button.

    Look at the RunCode macro action.
    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.

  5. #5
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38
    thanks but I am not sure how to do this? I looked into runcode from the drop down list in macro ( add new action) and all is asking for function name? how do I tell it to use the vba code? not too savy with this?
    Pasi.


    NO worries! I manage to make a function and call that function! it is working now! thanks so much for your help!! You Rock!!

  6. #6
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38
    June 7

    Can you tell me how to add the date to the File extension? like Myfile-12/27/13.txt?
    Thanks!!

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,913
    Slashes will be an issue so try:

    DoCmd.TransferText acExportDelim, , "tablename", "Drive\folderpath\filename_" & Format(Date(),"mmddyy") & ".txt"

    or

    Format(Date(),"mm_dd_yy")

    or

    Format(Date(),"mm.dd.yy")
    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.

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

Similar Threads

  1. Replies: 8
    Last Post: 06-04-2014, 10:41 AM
  2. Sample DB : Search Multiple Data Separated by Comma
    By spideynok in forum Sample Databases
    Replies: 3
    Last Post: 03-29-2012, 10:52 PM
  3. Replies: 6
    Last Post: 06-26-2011, 12:15 AM
  4. Replies: 2
    Last Post: 04-07-2011, 10:15 AM
  5. Replies: 1
    Last Post: 07-31-2009, 03:57 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