In a VBA module you can create the file names and then use DoCmd.TransferText method rather than a macro TransferText action.
Private Sub cmdExport_Click()
Dim file_name As String, tbl_name As String
file_name = "c:\data\export\ex" & Format(Date, "yymmdd" & ".txt"
table_name = "Depts"
DoCmd.TransferText acExportDelim, , table_name, file_name
End Sub
Terry
"I shall try to correct errors when shown to be errors, and I shall adopt new views so fast as they shall appear to be true views." - Abraham Lincoln
Thank you very much, that will work. One further question - I created a table that is updated from a query to make the "file name" and added an autonumber field and then another update q to add the autonumber to the file name so it looks like 1111-06301425-001.txt Can I reference this as the file name in the same way you suggested? That is call the "last record" by the field name as the text file name?
"I shall try to correct errors when shown to be errors, and I shall adopt new views so fast as they shall appear to be true views." - Abraham Lincoln
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.