Access 2003 - Macro Output File with current date

C

Cougarmutt

There has to be a way to either set up a macro to use a %date% type field in
the Output File dialog, but I cannot figure out what it is.

Here is the scenario:

I have a macro that runs 44 seperate reports every morning and placed
the reports (.SNP format) into a specific directory on a server where they
can and are viewed. Downside, Access is wanting me to approve the OVERWRITE
of each file. I want it to automatically overwrite the old file.

Or better yet, I would like to actually write the file with the current date
and time, for example:

instead of writing the file as c:\dir1\file1.snp
I want it to be c:\dir1\file1_02192008_131505.snp

Or something similar.

ANY ASSISTANCE WOULD BE A LIFESAVER!!

Please..............
 
C

Cougarmutt

OH, when i attempt to use either single or double quotes in the OUTTPUT FILE
text box, the ERROR I get says that the report cannot be written because i do
not have enough disk space for temp file creation. If I put in the straight
file name, no fancy info (like date() or anything, and remove all quotes, it
writes fine. If I put the date() commend in with no quotes it write
C\dir1\file1_date().snp

as in that actual text date() and not the real date info.
 
S

Steve Schapel

Cougarmutt,

Try it like this:

="C:\dir1\file1_" & Format(Now(),"mmddyyyy\_hhnn") & ".snp"
 

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