Hi
I use the code below to output a report for yesterday's activities in the daily log. The report is based on a query which filters only the events from yesterday to output.
However, I would like to be able to do a historic enquiry - say the log for three days ago was not compiled, I would like to be able to output the report based on a date in a userform.
Any ideas?
Thanks
Chris
I use the code below to output a report for yesterday's activities in the daily log. The report is based on a query which filters only the events from yesterday to output.
Code:
Set objaccess = CreateObject("Access.Application")
objaccess.AutomationSecurity = msoAutomationSecurityLow
objaccess.Visible = False
objaccess.OpenCurrentDatabase "\\bdifps01\Groups\Platform.Supervisor\DO NOT USE - Log (Front).accdb"
objaccess.DoCmd.OutputTo acOutputReport, "rptSupervisorsLogPreviousDay", acFormatPDF, Folder & "\BDI Supervisors Log for " & Format(Date - 1, "d") & " " & Format(Date - 1, "mmm") & " " & Format(Date - 1, "yy") & ", Created at " & Format(Time, "hhmm") & " on " & Format(Date, "d mmm yy") & ".pdf", , False
However, I would like to be able to do a historic enquiry - say the log for three days ago was not compiled, I would like to be able to output the report based on a date in a userform.
Any ideas?
Thanks
Chris