By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,499 Members | 829 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,499 IT Pros & Developers. It's quick & easy.

Creating a variable to change the name of an export file

P: n/a
I have a database that I periodically export to a text file for a Word mail
merge. I have a query that finds all of the records with a null export date
and a query that updates the export date to now().

I have a macro that runs the first query, uses TransferText to send it to a
file, then runs the update query. However, the file name in TransferText is
"hard wired" so whatever was there before gets written over.

Is there a way to create within the macro an environmental variable for the
file name based on date/time so that I can keep these export files?

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I would use VBA code.
The macro may accept something like this:

MyExportPath = myDir & Format(Now(), "yyyyMMddHHmmss") & ".txt"
--
Joe Fallon
Access MVP

"fresh" <fr*****@hotmail.com> wrote in message
news:lS********************@twister.nyc.rr.com...
I have a database that I periodically export to a text file for a Word mail merge. I have a query that finds all of the records with a null export date and a query that updates the export date to now().

I have a macro that runs the first query, uses TransferText to send it to a file, then runs the update query. However, the file name in TransferText is "hard wired" so whatever was there before gets written over.

Is there a way to create within the macro an environmental variable for the file name based on date/time so that I can keep these export files?


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.