FIGURE 7.16
An Excel timesheet filled with data from Access.
The CreateExcelTimesheetsprocedure listed as follows first sets up a DAO recordset of the
current week’s timesheets, and another recordset for that employee’s hours. The employee informa-
tion is entered on the worksheet first, then the code iterates through the Hours recordset, process-
ing the hours for each project and day, both regular hours and overtime, until all have been filled
in, and then loops to the next employee record:
Function CreateExcelTimeSheets()
On Error GoTo ErrorHandler
Part II Writing VBA Code to Exchange Data between Office Components