vba date output

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to add date to output file.
My vba module:
Function mcrOutputCouponChannelReport()
On Error GoTo mcrOutputCouponChannelReport_Err
Dim reportdate As Date

DoCmd.OutputTo acOutputReport, "unionqryCheckQueries", "MS-DOSText(*.txt)", "CouponChannelReport" & Format(reportdate, "mmddyyyy") & ".txt", False, "", 0, acExportQualityPrint

mcrOutputCouponChannelReport_Exit:
Exit Function
mcrOutputCouponChannelReport_Err:
MsgBox Error$
Resume mcrOutputCouponChannelReport_Exit
End Function


File is written as "CouponChannel123099.xls".
Thanks for the help.

patti
 
You never set a value for reportdate, so it defaults to 0, which for a date
field is midnight on 30 Dec, 1899.
 
Back
Top