View Full Version : How to a Catch duplicate error


neoklis
05-27-2008, 12:33 AM
Hi,

I have a front end Access and when I insert duplicate values becomes the error below. At which event can I catch the error?

Violation of PRIMARY KEY constraint ‘123’. Cannot insert duplicate key in object’ 678’

Thank you

boblarson
05-27-2008, 05:59 AM
You can check for duplicates in the Before Update event of the form.

neoklis
05-28-2008, 02:07 AM
Thanks for your reply but it is not working... I have tried the events of the form and the subform.. I have linked tables to SQL.. I am mentioning this, cause i dont know if i have to deal it with another way...

boblarson
05-28-2008, 06:16 AM
you need to be more specific - what code exactly have you tried in the before update event?