On Error Resume Next (but Only with Specific Error, like Err.Number = 70) 
Author Message
 On Error Resume Next (but Only with Specific Error, like Err.Number = 70)

Hey

On Error Resume Next, how Can I change this that it only resumes next if the
err.number = 70 ?

Thnx TP.



Mon, 13 Oct 2003 02:43:14 GMT  
 On Error Resume Next (but Only with Specific Error, like Err.Number = 70)
In your sub put:

On Error Goto JumpError

then at the end of the sub put this:

Exit Sub
JumpError:
If Err.Number = 70 Then
    Resume Next
Else
    Resume
End If
End Sub

Alex


Quote:
> Hey

> On Error Resume Next, how Can I change this that it only resumes next if
the
> err.number = 70 ?

> Thnx TP.



Mon, 13 Oct 2003 02:54:49 GMT  
 On Error Resume Next (but Only with Specific Error, like Err.Number = 70)
Assume this is your Sub / Function or Code, then just use something like the
following.

Private Sub YourSub
On Error GoTo ErrorHandler

'All other code goes here

LeaveSub:
Exit Sub

ErrorHandler:

  If Err.Number = 70 Then
    Resume Next
  Else
    Resume LeaveSub
  End If

End Sub

Regards Fred


Quote:
> Hey

> On Error Resume Next, how Can I change this that it only resumes next if
the
> err.number = 70 ?

> Thnx TP.



Mon, 13 Oct 2003 03:32:08 GMT  
 On Error Resume Next (but Only with Specific Error, like Err.Number = 70)
Sorry that doens't work, because it's complaining that the Object Variables
aren't set anymore.
That was my first guess to.

But Thnx Anyway.



Quote:
> Assume this is your Sub / Function or Code, then just use something like
the
> following.

> Private Sub YourSub
> On Error GoTo ErrorHandler

> 'All other code goes here

> LeaveSub:
> Exit Sub

> ErrorHandler:

>   If Err.Number = 70 Then
>     Resume Next
>   Else
>     Resume LeaveSub
>   End If

> End Sub

> Regards Fred



> > Hey

> > On Error Resume Next, how Can I change this that it only resumes next if
> the
> > err.number = 70 ?

> > Thnx TP.



Mon, 13 Oct 2003 04:48:27 GMT  
 On Error Resume Next (but Only with Specific Error, like Err.Number = 70)
Try this :-

Option Explicit

Private Sub Command1_Click()
    Dim LastErr
    On Error Resume Next
    Call Test
    If Err <> 6 Then
       LastErr = Err
       On Error GoTo 0  ' Clears Err
       Err.Raise LastErr
    End If

End Sub

Sub Test()
    Dim Q%, S$
    Q = Q / 0 ' Error 6
    'S$ = Dir("1:*.*") ' Error 53
End Sub

On Wed, 25 Apr 2001 18:43:14 GMT, "TP-Software"

Quote:

>Hey

>On Error Resume Next, how Can I change this that it only resumes next if the
>err.number = 70 ?

>Thnx TP.



Mon, 13 Oct 2003 14:06:46 GMT  
 On Error Resume Next (but Only with Specific Error, like Err.Number = 70)
If error.number = 70 then
blah blah blah
Eric C


Tue, 14 Oct 2003 10:15:45 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. On local error resume next Vs on error resuem next

2. Checking in Err Collection using On Error Resume Next

3. Error Number : 70 and Error Description : Permission Denied

4. cmd.Errors.Count Not Working (On Error Resume Next)

5. Runtime error(3012): On error resume next

6. Error 53 and error 70 not found in help file

7. Compile Error - Permission Denied (Error 70)

8. On Error Resume Next being ignored

9. Problem with On Error Resume Next in a converted database

10. On Error Resume Next has no effect

11. Resume Next doesn't trap error

12. ON ERROR RESUME NEXT Failure?

 

 
Powered by phpBB® Forum Software