By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,301 Members | 3,575 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,301 IT Pros & Developers. It's quick & easy.

Transfer Text File Name

P: 31
Using VBA, is there a way to transfer text a table or query and have the saved file name be some text followed by today's date (example"newfile.11.17.08.txt").

Also can that file then be winzipped and emailed using VBA? I know how to email it, but I want to zip it first.

Thank you for any help with this.
Nov 17 '08 #1
Share this Question
Share on Google+
2 Replies

Expert 5K+
P: 8,627
  1. One thing at a time. The following code will Output the contents of the Employees Table, in a Delimited Format, to a Text File in the C:\Test\ Directory. The File's Name will look something like:
    Expand|Select|Wrap|Line Numbers
    1. C:\Test\EmployeeTransfer11172008.txt
  2. Code Line:
    Expand|Select|Wrap|Line Numbers
    1. DoCmd.TransferText acExportDelim, , "Employees", "C:\Test\EmployeeTransfer" & Format$(Date, "mmddyyyy" & ".txt")
  3. Is this what you are looking for?
Nov 17 '08 #2

P: 31
Yes. Thank you very much. Makes sence. I will try that.
Nov 17 '08 #3

Post your reply

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