File Names and Query Criteria

  • Thread starter Thread starter Matt Massie
  • Start date Start date
M

Matt Massie

2 Issues I can seem to find any guidance on:
1. I have a macro with a series of TransferText (export
to .csv) Actions, say 4. They all use the same Export
specification. I would like the user to be able to run
the macro, and automatically get 4 different file names
saved into the default directory. I can manage that.
Here's my hang up. Can I save with a date stame in the
filename? Better yet, can I name the file based on the
data in a record in the query I'm exporting, AND a date
stamp? I.E.
For [Query1].[GEOCODE] the value for ALL records in "HK".
Can I automaticaly get a filename called "HK12182003.csv"

2nd Issue
Same Idea as above. A query of (group by
.
[geocode]) yields:
GEOCODE
"HK"
"NP"
"DS"

I want to run 3 mkTbl querys via a macro that one by one
uses the above results. I am trying to automate a very
long process of data manipulation for some inefficient
CPU users. Thanks for any assist!
P.S. Steve Schapel - Your advice on the outputTo post was
exactly what I needed. Now I want that text filename to
have the date stamp. Thanks again!
 
Access 2000
You will need 4 TransferText commands as you noted. The
file name can be appended with the date using the following
format.

="C:\dirname\filename" & Format(Date(),"mmddyy") & ".csv"

Jim
 
Back
Top