vba date output

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
 
D

Douglas J. Steele

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top