I have a continous subform (see screenshot), when I click the "Create" button I want it to copy all the data on that record and copy into a new table. This is the code I'm using:
Dim stDocName As String
Dim rs As dao.Recordset
Set rs = CurrentDb.OpenRecordset("t
rs!intSEID = Me.txtVSENum.Value
rs!intIncidentID = Me.intIncidentID.Value
rs!intPeopleID = Me.intPeopleID.Value
rs!txtFirstName = Me.txtFirstName.Value
rs!txtMiddleName = Me.txtMiddleName.Value
rs!txtLastName = Me.txtLastName.Value
As long as no other record on the continous subform has ever called this before... it works. But if I call it twice (on different records), it won't copy the second time even though it's all new data. I get this error:
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 primary to permit duplicate entries.
See sample, I was able to add Complaint #8 no problem, go to create Complaint #5 and I get the error and it doesn't create the copy in the tblSE
I've stepped through the code and know that it's a unique ID I'm trying to pass.
I also removed the primary key on this table to allow duplicates as a test, and I still get this error.
Could it be an issue with me using a continious form?