Export to .txt file

  • Thread starter Thread starter DChitwood
  • Start date Start date
D

DChitwood

Access 2000
I've figured out how to create a macro that will export a
table to a .txt file using a static file name. However, I
need for the resulting .txt file to be different every
time. This macro will be used by a person whose ability
is pretty much limited to point, click, and fill in a pop-
up box or two. How can I write the macro so that it
prompts the user for a file name to which the table should
be exported?

Thanks so much for your help!
 
In the argument for the filename, use the InputBox function:

DoCmd.TransferText acExportDelim, "Specification Name", "TableQueryName", _
"PathToExportedFile" & InputBox("Enter the name of the text ("".txt"")
file to be created:" _
,"Enter File Name") & ".txt"
 
Back
Top