I'd suggest you use a module rather than a macro.
The easiest way to do it would be this:
Open your macro in design view,
choose save as, then select as Module
You may as well leave the error handling and comments boxes checked
Then open the module (which will be named something like "Converted Macro- Macro1"
The command that actually does the work is the line
Code:
DoCmd.OutputTo......
Where you've got the existing filename in that line, change the code to include today's date (remembering that slashes can't be used)
So you'll start out with something along the lines of
Code:
DoCmd.OutputTo acTable, "YourTable", "MicrosoftExcelBiff8(*.xls)", "C:\something.xls", False, "", 0
and end up with something like:
Code:
DoCmd.OutputTo acTable, "YourTable", "MicrosoftExcelBiff8(*.xls)", "D:\Stuff_" & Format(Now(), "yyyymmdd") & ".xls", False, "", 0
Which will give you the filename something like D:\Stuff_20050102.xls
Next problem is calling that code.
To make it easier (and if you prefer macros to real coding), you could make another macro, with the action being "RunCode", and then select the function from there.
Steven
Steven
I am a loud man with a very large hat. This means I am in charge
(Edited due to type in code)