Error

Go to the function in the code editor and go to the 1st line (Private Function...) and double click to the left of the line but inside the edit window. The whole Function should highlight. Now do Edit>Copy or <Ctrl>C. Now reply to this post and start with the {code} tag, then do a Paste or <Ctrl>V then put {/code}. remember to use [brackets] instead of {braces}. Post back if you need more assistance.
 
I'm Lost.

Here's the code.

Option Compare Database

Function SomeName()
On Error GoTo Err_SomeName ' Initialize error handling.
' Code to do something here.
Exit Function ' Label to resume after error.

Err_SomeName: ' Label to jump to on error.
MsgBox Err.Number & Err.Description ' Place error handling here.
Select Case Err.Number
Case 9999 ' Whatever number you anticipate.
Resume Next ' Use this to just ignore the line.
Case 999
Resume Exit_SomeName ' Use this to give up on the proc.
Case Else ' Any unexpected error.
Call LogError(Err.Number, Err.Description, "SomeName()")
Resume Exit_SomeName
End Select

Resume Next ' Pick up again and quit.
End Function

Again, its from Allan Browne.:rolleyes:
 
This is what your post would have looked like if you had used the code tags.
I also made some changes.
Code:
Function SomeName()
   On Error GoTo Err_SomeName   ' Initialize error handling.
'
'
' Code to do something here.
'
'
[COLOR="Red"]Exit_SomeName:[/COLOR]
   Exit Function   ' Label to resume after error.

Err_SomeName:      ' Label to jump to on error.
   MsgBox Err.Number & Err.Description   ' Place error handling here.
   Select Case Err.Number
   Case 9999   ' Whatever number you anticipate.
      Resume Next   ' Use this to just ignore the line.
   Case 999
      Resume Exit_SomeName   ' Use this to give up on the proc.
   Case Else   ' Any unexpected error.
      Call LogError(Err.Number, Err.Description, "SomeName()")
      Resume Exit_SomeName
   End Select

   [COLOR="Red"]'-- The next line will NEVER execute!!
   Resume Next   ' Pick up again and quit.  --- This line is NOT needed!![/COLOR]
End Function
 

Users who are viewing this thread

Back
Top Bottom