private Sub Form_Load()
On Error Goto ErrorHandler
Dim I as long
' Only Select the columns you require
With db.OpenRecordset("Select " & _
"dtmCourseStartDate, " & _
"dtmFireWardenMarshalRefresherDate " & _
"FROM qryHealthSafetyMatrixFireSafetyFireWarden")
If not (.EOF And .BOF) Then
.MoveFirst
Do While Not .EOF
.Edit
.dtmFireWardenMarshalRefresherDate = DateAdd("yyyy",3, .dtmCourseStartDate)
.Update
i = i + 1
.MoveNext
Loop
.Close
Else
MsgBox("No Records Found")
End If
End With
DoneLoad:
Exit function
ErrorHandler:
MsgBox("Error Updating Dates. " & vbcrlf & _
I & " records were update." & vbrlf & _
"Some may not have been updated. " & vbcrlf & _
Err.Description
Resume DoneLoad
End Sub