Export to .txt file

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!
 
K

Ken Snell

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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top