Problem with error handling

der_roedie

New Member
Joined
Dec 16, 2009
Messages
29
Hello,

I've created an application that connects to a database and then retrieves records from there.
This data is then send to another system that contains data for these records.
Sometimes it can happen that for a record no data exists in the second system. This raises an error in my program, so i've added small errorhandlers to coop with this problem.

BUT: the first occasion this happens, the error get handled by the errorhandler and I continue my program withe the next record. But if that records also has no data then the errorhandler does not work :confused:

This is the code for the error handler:

Code:
If Err.Number = -2147220469 Then
    Err.Clear
    rst.MoveNext
    GoTo pointnotexist
End If

The number is the same for the second error so it should work i guess. I've added Err.Clear to reset the error before continuing but that didn't work either.

Any help and tips would be appreciated.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Would be better to see all of the code, but ry this

Code:
If Err.Number = -2147220469 Then
    Err.Clear
    rst.MoveNext
    Resume pointnotexist
End If
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top