Do..While loop error handling

  • Thread starter Thread starter Luis
  • Start date Start date
L

Luis

Hello.

I have a DO .... WHILE loop that can generate some errors. The error usually
is the same, but everytime this error occurs i whant to call an error
handling.
The problem i'm having is that only in the first time that the error occurs,
the error handling is called. After that the error handling is not triggered
again. Can anyone give me a hint?

The code i'm using is something like the following.

do
1:
x=rs!field1
Err.Clear
 
Luis said:
I have a DO .... WHILE loop that can generate some errors. The error usually
is the same, but everytime this error occurs i whant to call an error
handling.
The problem i'm having is that only in the first time that the error occurs,
the error handling is called. After that the error handling is not triggered
again. Can anyone give me a hint?

The code i'm using is something like the following.

do
1:
x=rs!field1
Err.Clear
.
.
.
.
On error goto 1
DoCmd.RunSql(".....")

loop while not rs.eof

On Error GotTo must go to an error handling blovk of code
that eventually performs a Resume statement. Try simething
more like:

On Error GoTo ErrHandler1
do
1:
x=rs!field1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top