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.