For example I have a form with 2 field: a field and b field.
Some time I input a duplicate value of primary key then access
display 3002 error message to inform about the duplicate of primary key.
I just learned a bout error handling with on error goto something ...
But in this case, I don't know how to handle about the duplicate of primary key.
Could anyone teach me in detail how to handle error about duplicate of primary
The only place I believe you can trap this error is in the Form Error event. You can, however, validate input before committing the data to disk i.e. in the form before update event check the table for the existance of the primary key you are about to commit. If it exists, politley inform your user and and cancel the commit