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 / Queries / August 2007

Tip: Looking for answers? Try searching our database.

Help with automating file name

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mattc66 - 30 Aug 2007 22:18 GMT
I have the following code that exports the below query to excell. I would
like the files name to include the month and date. How would I format this?

DoCmd.OutputTo acOutputQuery, "qryShopOrderSqFtShippedSummaryExport",_
acFormatXLS, "W:\Cokato\Production\ProdRoomRpt.xls"

Signature

Matt Campbell
mattc (at) saunatec [dot] com

'69 Camaro - 31 Aug 2007 06:15 GMT
Hi, Matt.

> I would
> like the files name to include the month and date.

Uh, . . . the date _always_ includes the month, unless you're referring to a
different calendar than the rest of us normally use.  Perhaps you mean the
month and day?  If so, try:

DoCmd.OutputTo acOutputQuery, "qryShopOrderSqFtShippedSummaryExport",_
   acFormatXLS, "W:\Cokato\Production\ProdRoomRpt_" & _
   Month(Date()) & "_" & Day(Date()) & ".xls"

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
takzie - 31 Aug 2007 06:44 GMT
>I have the following code that exports the below query to excell. I would
>like the files name to include the month and date. How would I format this?
>
>DoCmd.OutputTo acOutputQuery, "qryShopOrderSqFtShippedSummaryExport",_
>acFormatXLS, "W:\Cokato\Production\ProdRoomRpt.xls"

Hi Matt,

try this:

DoCmd.OutputTo acOutputQuery, "qryShopOrderSqFtShippedSummaryExport",_
acFormatXLS, "W:\Cokato\Production\ProdRoomRpt "&format(now(),"mmm dd")&".
xls"

You may want to play with the date formatting to display the desired date
format that you want.

Hope this help.
 
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.