jason12776
Technical User
I am using ADODC and using access 2000. I have a form that enables a user to search for an item using an item id. When the user clicks on the search button, a new form appears, enabling the user to type in the item id, then the results will appear on the main form. The problem is when I try to add a record from that result, or edit that result, I get the message, run-time error -'2147467259 (800004005)': The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship...
I know what the error means, I think, but there is nothing in my code that, I think, would cause this error to happen.
Private Sub cmdAddMovie_Click()
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.AddNew
' There is a lot more code, but this deals
' with the database
End
Private Sub cmdSave_Click()
If txtID.Text <> "" Then
Adodc1.Recordset.Update
end if
' Same as above, a lot more code, but it isn't relavent
End
I can click on the edit button, but when I click on save, I will get the same message.
Also, I noticed when I am already on the record, i.e. record 2, and I type in the ID of record 2, I will not get any error messages. Any suggestions.
Cheers.
I know what the error means, I think, but there is nothing in my code that, I think, would cause this error to happen.
Private Sub cmdAddMovie_Click()
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.AddNew
' There is a lot more code, but this deals
' with the database
End
Private Sub cmdSave_Click()
If txtID.Text <> "" Then
Adodc1.Recordset.Update
end if
' Same as above, a lot more code, but it isn't relavent
End
I can click on the edit button, but when I click on save, I will get the same message.
Also, I noticed when I am already on the record, i.e. record 2, and I type in the ID of record 2, I will not get any error messages. Any suggestions.
Cheers.