访问需要不覆盖报告

Access need to not overwrite reports

这里发生的是报告每天都在覆盖。我怎样才能使输出名称唯一(也许带有日期)?这样就不会每次都被删除了?

Public Function RunDMR()
'E:\Management Reports
Dim myfile As String
myfile = "E:\Management Reports\B3-Daily Fiscal Report on Net Estimated to Receive by Ins - 45.pdf"

DoCmd.OutputTo acOutputReport, "B3: Daily Fiscal Report on Net Estimated to Receive by Ins - 45", acFormatPDF, myfile, False

End Function

要向报告名称添加日期,请使用以下内容:

myfile = "E:\Management Reports\B3-Daily Fiscal Report on Net Estimated to Receive by Ins - 45_" & format(date,"YYYYMMDD") & ".pdf"

要向报告名称添加日期和时间,请使用以下内容:

myfile = "E:\Management Reports\B3-Daily Fiscal Report on Net Estimated to Receive by Ins - 45_" & format(Now(),"YYYYMMDD_HHMMSS") & ".pdf"