- continued from previous thread -
2. How to handle an event.
Two ways to handle events - proactive and reactive. (best to use a combination)
-A proactive approach means determining whether an error will occur and dealing with the error situation to avoid it by either changing data values to avoid the error or cancelling the event/action that caused the error to occur (not all events can be cancelled) and reporting the error situation to the user.
- A reactive approach will usually invoke an error within your code that adds/edits/calculates/deletes etc and should be picked up in the following construct of a function:
-------
Private Sub ThisFunction (strThisValue As String) As Boolean
dim strFunctionName as String
strFunctionName = "ThisFunction"
On Error GoTo Err_ThisFunction
Exit_ThisFunction:
Exit Sub
Err_ThisFunction:
Select Case Err.Number
Case 1
MsgBox "Error Type 1 has occurred.", vbCritical, strFunctionName
Case 4576
Msgbox etc
End Select
Resume Exit_ThisFunction
-------
In your example, it appears as thought your application is attempting to move past the end of the current recordset - but I can't determine why without looking at the code itself. Perhaps other readers can figure out the exact reason...
Hope it all helps - good luck.