FIGURE 7.11
Date information automatically filled in after selecting an employee.The CurrentWeekEndingand FillDateControlsprocedures are listed as follows:Public Function CurrentWeekEnding() As DateOn Error GoTo ErrorHandlerDim dteToday As DatedteToday = Date
Do While Weekday(dteToday) <> vbSunday
dteToday = dteToday - 1
Debug.Print “Testing “ & dteToday
LoopCurrentWeekEnding = dteTodayErrorHandlerExit:
Exit FunctionErrorHandler:
MsgBox “Error No: “ & Err.Number & “; Description: “ &
Err.Description
Resume ErrorHandlerExitEnd FunctionPart II Writing VBA Code to Exchange Data between Office Components