Form on a loop? "duplicate values in the index, primary key, or relationship."
Hi everyone, I am new to operating access. I have a form that appears to be on a loop of some sort. My form is linked to a table and query to search for previous participants. Before the form comes up a query comes up to search for the previous participant, but I am wanting to add a new participant so I have a button to select add new. Once on my main form I have it set to enter a new program participant ID and date of contact then select Add New Participant, and this is where access auto populates another participants information with a different number and data. I attempt to overwrite the old number and it doesn't work. Any thoughts?
Here is the code for creating a new record,
Hi everyone, I am new to operating access. I have a form that appears to be on a loop of some sort. My form is linked to a table and query to search for previous participants. Before the form comes up a query comes up to search for the previous participant, but I am wanting to add a new participant so I have a button to select add new. Once on my main form I have it set to enter a new program participant ID and date of contact then select Add New Participant, and this is where access auto populates another participants information with a different number and data. I attempt to overwrite the old number and it doesn't work. Any thoughts?
Here is the code for creating a new record,
Code:
Private Sub cboSelectParticipant_AfterUpdate()
Dim rs As Object
If Me![cboSelectParticipant] = 0 Then
DoCmd.GoToRecord , , acNewRec
Else
Set rs = Me.Recordset.Clone
rs.findfirst "[VictimID] = " & Str(Me![cboSelectParticipant])
Me.Bookmark = rs.Bookmark
End If
End Sub