![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a sql server table that is linked into access2007 I have a unique index on a field in that table I have a form where I deliberately enter a duplicate value for this field if I have a command button that does * *me.dirty = false I can trap the error (3146), and err.description will indicate the name of the index as part of the error message * * [Microsoft][ODBC SQL Server Driver][SQL Server]Violation of UNIQUE KEY constraint 'baanItemNullBuster_uq'. * *Cannot insert duplicate key in object 'dbo.tblItem'. (#2627) [Microsoft][ODBC SQL Server Driver][SQL Server] * *The statement has been terminated. (#3621) this allows me to provide a very specific error message if the user uses the standard access form interface to 'save' a record, the error is triggered via the onError event * *Form_Error(DataErr As Integer, Response As Integer) and dataErr has the correct error number so that I can detect the fact that a duplicate value was entered but I can't find anything (err.description, errors() array) that will give me the error string so that I can report which field has the duplicate is there such a variable ? |
![]() |
| Thread Tools | |
| Display Modes | |
| |