Export table to txt file with a variable filename

May 14, 2011
Reaction score
Hello, I tried doing some searching on this but wasn't finding much. I am very comfortable with Excel and so-so at creating macros in Excel with VBA but when it comes to Access I am much more of a rookie.

My current setup - Access 2007-2010, win7 64bit
I have a macro that does the following
- runs saved import to import excel file to table ("Table_Import")
- runs a make table query ("Query 1") to make new table ("Table 1")
- runs a make table query ("Query 2") to make new table ("Table 2")
- runs saved export to export Table 2 as text file ("Export File").

My dilemma: Query 2 gives the user a prompt [Enter date] where users will enter the date of the records they want to include (ex: 7/10 or 7/10/12) in the final output. What I would like to do is have the name of the txt "Export File" include the variable the user entered (ex: Export File_07.10.12).

Thanks in advance for any help!

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