Quote:
Originally posted by gerard
I have a datagrid with some records...if I add a record with a duplicate primary key I get an ODBC error informing that I have attempted to adda record with duplicate key...I'm happy with this BUT...the there are no error numbers or any visible way I can set up an error trap for this situation..is there a way that I can trap this error!
I'm using an Access 97 database with ADO as my method of access.
Ta
Gerard
Check the value of Err.number in debug, after you attempt to add a duplicate key. Then add code to check for that value.