Is there any way to repeat the current line on error? 
Author Message
 Is there any way to repeat the current line on error?

Hello all,

        I want to set on error resume statement that can repeat the
current line? How can I write that. Maybe something like that: on
error resume. Please Help . Thanks.



Sat, 11 Dec 2010 13:17:43 GMT  
 Is there any way to repeat the current line on error?

Quote:
> Hello all,

> ? ? ? ? I want to set on error resume statement that can repeat the
> current line? How can I write that. Maybe something like that: on
> error resume. Please Help . Thanks.

This will only work in IDE mode.

Activate a stop in your error handler and after you step back to your
calling routine, manually move your code pointer to a single isolated
line that has a Resume on it and then step into that statement. Your
code pointer will then point at the line that gave the error.

For Example:

    Exit Property
    Resume
errline:
    'stop
    Resume Next
End Property



Sat, 11 Dec 2010 15:01:23 GMT  
 Is there any way to repeat the current line on error?
Quote:

> Hello all,

>         I want to set on error resume statement that can repeat the
> current line? How can I write that. Maybe something like that: on
> error resume. Please Help . Thanks.

You gave the answer yourself:
<code>
Private Sub foo()
     On Error GoTo ErrHandler

     Debug.Print 1 / 0  'causes an error

     Exit Sub

ErrHandler:
     Resume
End Sub
</code>

Make sure you don't get in an endless loop here!

Sinna



Sat, 11 Dec 2010 15:00:29 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Repeating columns across a detail line

2. Repeat info by column rather than line

3. Show me the error of my ways (SSTab)

4. Locking error, DataControl Error, or am I stupid ?

5. Locking error, DataControl Error, or am I stupid ?

6. What Line number am i on?? question

7. I am looking for a few lines of VB code

8. Need really help - Repeat: Error 3289 in CONSTRAINT clause

9. Current Line Number in an Access Module

10. Finding current line number in Access 97 module

11. Determine current Line in Word

12. start of current line in string

 

 
Powered by phpBB® Forum Software