In Macro - Creating an output file with a different name each time

A

AJCB

Hello.

I don't know if anyone can help, but I have a slight problem.

I have a report that I currently send out by email using a macro, each time
I press a button.

Is it possible that instead of sending this file out, that I save the
snapshot file to a location with a different file name each time, or to be
prompted to enter the file name manually?

Regards
AJ
 
W

Wayne-I-M

Hi

I don't think you can do it in a macro - I may be wrong about this.

You can do it with a little code - it's not too hard to create

What you need to supply the people in this forum with is

The name of the report you have now
The name you want to save the report as
eg. I output report to various people like this

Say me report name is
rptMyReport

I have a list (in a table) of people's names.

The report is output (you can save them if you want) as
Johns report for 25 December 2008
Jills report for 1 January 2009
Jacks report for 21 January 2009
etc
etc

This is then e mailed to them - but you don't have to e mail them, you can
just save them - BUT as you can run a report at any time it seems a bit of a
waste of disk space to just save them


Can you give more details about what it is you're trying to do ?
 
A

AJCB

Hi,

Thanks for responding.

We have a head office in a different part of the country, and I currently
email 4 people the report.

They are now complaining that they are receiving too many emails, so what I
wanted to do was when the macro runs, I wanted it to save a file in a
specified folder with a unique name, eg. 21/01/2009 15:56:00.snp.

Is this possible?
 
W

Wayne-I-M

Sorry got to go out now

I will post the code in the morning if no-one else does

Or you can try yourself

Use
DoCmd.CopyObject (to rename it with the date)
and
DoCmd.Outputto (to dave to your folder)
 
A

AJCB

Sorry, I think you might have the wrong end of the stick.

I am trying to send a snapshot file to a location on our server, changing
the name of the file each time automatically without the user even knowing
about it?

Is it possible in a macro?

Cheers
AJ
 

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