Help with transfertext method

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jmar93
    New Member
    • Mar 2008
    • 46

    Help with transfertext method

    Hi,

    I am using Acess 2007 and am writing the data from a table into a text "CSV" file using the "transferte xt" method. I run the following code and it creates the file with a name I input at runtime and saves the file to my documents folder. I can't figure out how to specify a different location to save the file without hard coding the location and file name. Any help will be greatly appreciated.

    Code:
    Dim Message, Title, Default, MyValue
    Message = "Enter PO Number"    ' Set prompt.
    Title = "Enter PO Number"    ' Set title.
    MyValue = InputBox(Message, Title)
    DoCmd.TransferText acExportDelim, , "table1", MyValue & ".csv", True
    thanks,
    Jeff
    Last edited by NeoPa; Oct 5 '10, 02:47 PM. Reason: Please use the CODE tags provided
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    For these types of situations, I like to use the Standard Window's Folder Dialog which provides a professional look as well as being basically foolproof. It is a little difficult to explain here since it does use the API, but I have provided a fully functional Demo for you to look at and appraise. Good luck, and any questions, please feel free to ask.
    Attached Files

    Comment

    Working...