I've been fooling around with various VB codes to achieve the desired affect of restricting someone entering duplicate information, as well notify and forward the person to the original record if having done so. I played around with a few different ways to go about it with no real success, I recently discovered someone demonstrating how to do exactly what I want, so I copied the code and replaced the necessary fields to specify my database. Everything runs smoothly without any errors whatsoever, however it also doesn't actually direct me to the duplicated record, it instead shoots me always to the first record within the form. I'm curious if anyone knows why this might happen. I'll post my code and some screen shots to clarify what I mean.
This is what occurs after entering a duplicate yc tag
After pressing okay it brings you to the first record in the form, not the duplicated record.
Thank you in advance for any advice or idea you guys can give me, it's been one step forward ten steps back for two weeks now just with this small feature.
Code:
Private Sub YC_TAG_AfterUpdate()
Dim SID As String
Dim stLinkCriteria As String
Dim rsc As DAO.Recordset
Set rsc = Me.RecordsetClone
SID = Me.[YC TAG].Value
stLinkCriteria = "[YC TAG] = '" & SID & "'"
'Check Assets table for duplicate YC_TAG
If DCount([YC TAG], "Assets", _
stLinkCriteria) > 0 Then
'Undo duplicate entry
Me.Undo
'Message box warning of duplication
MsgBox "Warning YC TAG " _
& SID & " has already been entered." _
& vbCr & vbCr & "You will now be taken to the record.", _
vbInformation, "Duplicate Information"
'Go to record of original Student Number
Me.Form.DataEntry = False
Set rsc = Me.RecordsetClone
rsc.FindFirst stLinkCriteria
Me.Bookmark = rsc.Bookmark
End If
Set rsc = Nothing
End Sub
This is what occurs after entering a duplicate yc tag

After pressing okay it brings you to the first record in the form, not the duplicated record.

Thank you in advance for any advice or idea you guys can give me, it's been one step forward ten steps back for two weeks now just with this small feature.