Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2005

Tip: Looking for answers? Try searching our database.

Naming files using date string using OutputTo

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MH UK - 15 Dec 2005 10:36 GMT
I'm sure this is easy but, using the OutputTo command I am outputting several
queries as spreadsheets. That is so easy, even I can do it! What I am
struggling with is incorporating the current week number in the file name as
I export weekly and don't want to overwrite each file each week.
e.g. to name a file Sales_PerformanceWk46.xls where "46" will automatically
vary each week and thus become Sales_PerformanceWK47.xls next week.

Thanks,

MH
Graham R Seach - 15 Dec 2005 11:23 GMT
   DoCmd.OutputTo acOutputQuery, _
                 "qryMyQuery", _
                  acFormatXLS, _
                 "C:\Temp\Sales_PerformanceWk" & DatePart("ww", Date) &
".xls"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

> I'm sure this is easy but, using the OutputTo command I am outputting
> several
[quoted text clipped - 9 lines]
>
> MH
MH UK - 15 Dec 2005 11:41 GMT
Thanks Graham.
I was close but couldn't get the format right. I was placing " " incorrectly.

>     DoCmd.OutputTo acOutputQuery, _
>                   "qryMyQuery", _
[quoted text clipped - 21 lines]
> >
> > MH
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.