I am developing a Report in MS Access that pulls a list of employees. It generates a daily sign-in sheet which then gets posted in each department.
I would like to open the report, ask for the "Start Date", and then print that report for the next 7 days, increasing the "Start Date" parameter by 1 on each copy. (the start date is not stored in the database, its just an input parameter that gets used to print on the report)
The report is grouped by department and each department prints on a new page (Group Header section has "Force New Page" set "Before Section").
I am assuming this all needs to be done in VBA in a while loop from the Click() event of the Command button that opens the report, but I am out of my league here. Any idea how to accomplish this?
The way that I would do this is:
tblReportDate) to store the date in a field calledReportDate;txtReportDatethat has an input mask suitable for dates;=DLookUp("ReportDate","tblReportDate");OnClickevent:I prefer to use a small form rather than the built-in
InputBoxas you can use the input mask to enter the date.In this example, I am just outputting the report as a PDF before closing it. You may wish to use
DLookupas part of the name, rather than the loop counter that I am using.Regards,