Export "Transfer" Query to Excel

Mallol02

Registered User.
Local time
Today, 01:11
Joined
Feb 23, 2009
Messages
15
Hi everyone,

i have a DB that i have to transfer some information from my table to a spreedsheet in Excel. i have no problem at all to do this event, but my concern is if i can actually give a periodical name to the file that i'm tranfering. for example 03/03/09TBLSCHOOL and for the next month 04/03/09TBLSCHOOL. i don't know if a express myself right. but this is my code i'm using.

Function EscMod()
On Error GoTo EscMod_Err

DoCmd.TransferSpreadsheet acExport, 8, "qrySCHOOL", "C:\SYSTEM DATA\TBLSCHOOL", False, ""
DoCmd.Echo True, ""

EscMod_Exit:
Exit Function
EscMod_Err:
MsgBox Error$
Resume EscMod_Exit
End Function
There is any code that i can use to change file name to the date i'm transfering or a specific month???

Thanks in advance
 
add something like "yourfile" & Format(date(), "YYYYMMDD") to your filename and you should be good to go.
 
Namliam,

Thanks for your Help this code works excellent..
and its what i'm looking for!
 

Users who are viewing this thread

Back
Top Bottom