Automate Access 2010 module to export query to tab delimited text file

I have a query called qry-EXPORT that I need to be able to export via module in Access 2010. I need to export this file to C:\Temp and the file name needs to be DataExport.txt

I have been able to do this via the Export Text file option in Access, and have even saved the steps to do this but I need to automate this process of exporting the file via windows scheduler and I think that I can do this via a module the best.
wilpitzAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dale FyeCommented:
use the TransferText method.  Syntax looks something like:

docmd.TransferText  acExportDelim, [SpecificationName], [Table Or Query Name], "C:\temp\DataExport.txt", True
0
Rey Obrero (Capricorn1)Commented:
use this codes to automate the export, place the codes in a regular module

Function ExportFile()
docmd.RunSavedImportExport ("Name Of Saved Export")

end function
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PatHartmanCommented:
To create [SpecificationName] as referenced by Dale, you must first export the query ONCE, manually.  On the last form of the dialog, click the Advanced button.  That is where you will specify the format for the export and also save it.  Once it is saved, you can refer to it using the TransferText method.
0
wilpitzAuthor Commented:
This worked with what I had in place, very easy and worked great!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.