469,128 Members | 1,559 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,128 developers. It's quick & easy.

Help with transfertext method


I am using Acess 2007 and am writing the data from a table into a text "CSV" file using the "transfertext" 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.

Expand|Select|Wrap|Line Numbers
  1. Dim Message, Title, Default, MyValue
  2. Message = "Enter PO Number"    ' Set prompt.
  3. Title = "Enter PO Number"    ' Set title.
  4. MyValue = InputBox(Message, Title)
  5. DoCmd.TransferText acExportDelim, , "table1", MyValue & ".csv", True
Oct 5 '10 #1
1 1589
8,800 Expert 8TB
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
File Type: zip TransferText.zip (21.3 KB, 80 views)
Oct 5 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by daniel.w.gelder | last post: by
1 post views Thread by Jack Addington | last post: by
2 posts views Thread by Anthony Nystrom | last post: by
1 post views Thread by Chris Calzaretta | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.