I have a main form in the DB where I have several command buttons for reports. I save these Excel and PDF reports in a common folder as seen below
Private Sub Command57_Click()
DoCmd.OutputTo acOutputReport, "rptContainersInTransit", acFormatPDF, "C:\Access\ContainersTransit.pdf"
End Sub
Private Sub Command58_Click()
DoCmd.OutputTo acOutputQuery, "qryContainersInTransit", acFormatXLSX, "C:\Access\ContainersTransit.xlsx"
End Sub
The new files naturally overwrites the previous file.
Can I add a code such that the file name has a system date in it and and a suffix 0,1,2 is added as shown below
ContainersTransit-08102020-0
We use the DDMMYYYY format for dates and -0 is the first file of this date
Is this desire too much to ask from Access?
Private Sub Command57_Click()
DoCmd.OutputTo acOutputReport, "rptContainersInTransit", acFormatPDF, "C:\Access\ContainersTransit.pdf"
End Sub
Private Sub Command58_Click()
DoCmd.OutputTo acOutputQuery, "qryContainersInTransit", acFormatXLSX, "C:\Access\ContainersTransit.xlsx"
End Sub
The new files naturally overwrites the previous file.
Can I add a code such that the file name has a system date in it and and a suffix 0,1,2 is added as shown below
ContainersTransit-08102020-0
We use the DDMMYYYY format for dates and -0 is the first file of this date
Is this desire too much to ask from Access?