i am trying to do a simple addNew into a table - nothing special. it seemed to work a little while back, now suddenly i am gettimng the following error. i have even tried commenting out all the inserted fields, except for one at a time - and i still get the error - which leads me to believe that its not to do with any specific field (cos anyway there is only one primary key field which i dont touch).
any ideas?
thanks!
Microsoft JET Database Engine error ‘80004005’
The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.
In the end it was a problem in the Access Db. for some odd reason (Still to be found) - it would generate a autonumber thats already been used (!!!) - really dont know how that could happen, even after a repair/compact. wierd!!!
[QUOTE=doctorallia]
I would recommend using an SQL string to insert rather than Addnew
[/QUOTE]
How can i do this? with copying all fields of a record to a new row - except for changing one field value?
thanks
I would use a recordset to get the info on a record and then execute an SQL statement to insert a new record with the values from that along with the changed value. The format would be something like this: