Output To question (1 Viewer)

Emmanuel

Master Tech
Local time
Today, 11:19
Joined
Sep 4, 2002
Messages
88
Hey guys,

I have a macro that both opens and updates a query and then does an output to command which exports a table previously created on an excel format.

Here is the hard part. I need the macro to run every day and export the file but without overriding the previous one. Therefore I need the file name to contain the date within the name so each one will be unique. Any suggestions? I could even try it in the query or do an update query if you guys have another way other that the macro.

Thanks in advance for your help.

Emmanuel
 

reclusivemonkey

Registered User.
Local time
Today, 16:19
Joined
Oct 5, 2004
Messages
749
Erm, add the date to the name in VBA? I think you answered your own question there.
 

Emmanuel

Master Tech
Local time
Today, 11:19
Joined
Sep 4, 2002
Messages
88
reclusivemonkey,

I believe I did not as far as a way of doing it automatically. Now on the other hand I need to thank SMatthews for his help in comming around with the solution found below for your benefit:


Function Macro1()

Dim strdate as String

strdate = format$(date, "mmddyy")

DoCmd.SetWarnings False
DoCmd.OutputTo acQuery, "Converters Without Matching Remotes", "MicrosoftExcelBiff8(*.xls)", "\\Tbhilfs1\tbhildfs1\TB-HIL\Scripting\Manny\test" & strdate & ".xls", False, "", 0
DoCmd.SetWarnings True

End Function




Best Regards,

Emmanuel
 

reclusivemonkey

Registered User.
Local time
Today, 16:19
Joined
Oct 5, 2004
Messages
749
For my benefit? I already know how to do this, thats why I was attempting to help :) I failed to see the reply by SMatthews?
 

Users who are viewing this thread

Top Bottom