Hi! I just want to share you this code snippet of mine which I use always in my application.
This code snippet will help you debug your code easily. It will also help you locate where the error occurred and it also create an Error log located on your project directory.
In Visual Basic, Erl, a Visual Basic (undocumented in Visual Basic 4, 5, and 6 but present in all versions of Visual Basic thus far) "global variable," gives you access to the line number of any erroring line of code. So by using line numbers and by using Erl in your error handlers, you can determine which line of code erred-wow! What happens to Erl if you don't use line numbers? it will always be 0.
You can use the attach file that I created my self to Add and Remove Line Numbers in your code.
You can use the prompt_err function with line number in your code like this.
Sub Update_Details()
On Error GoTo errHand
1 If rs.EOF = False Then
2 MessageBox ErrorHere
3 End If
Exit Sub
errHand:
prompt_err Err, "Form1", "Update_Details"
End Sub
Try the function and see the result. Hope you like this one. Thanks.