Trap Error

burrina

Registered User.
Local time
Today, 13:21
Joined
May 10, 2014
Messages
972
Follow up question. Since I have a Composite Index to prevent duplicates I get the error message. How can I trap this?

I resolved it with this code.

Thanks,
PHP:
'Trap Error.
Dim DataErr As Integer
Dim Response As Integer
Dim Message As String
If DataErr = 3022 Then 'Duplicate value entered
Response = acDataErrContinue
End If
 

Attachments

  • CompositeIndexError.jpg
    CompositeIndexError.jpg
    44.4 KB · Views: 87
Last edited:
Either pre-test for clashes in the before update event.

Or trap the 3022 error in the forms error event.
 
burrina,

If you don't have MZTools for VBA, get it. It can add a generic error handler to your procedures with 1 click. You can customize the logic with the 3022 etc.

It does a lot more, also.
Good luck.
 

Users who are viewing this thread

Back
Top Bottom