S
Sher
I have created a before update event listed below. What I would also like it
to do is go to the record that is in the database. I thought that was what I
was doing but it isn't working. Can someone please help.
Private Sub SSN_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("[SSN]", "Security", "[SSN]= '" & Me![SSN] & "'")) Then
MsgBox "This SSN already exists."
Cancel = True
Me.Undo
DoCmd.GoToRecord , , acFirst
DoCmd.FindRecord SSN
End If
End Sub
to do is go to the record that is in the database. I thought that was what I
was doing but it isn't working. Can someone please help.
Private Sub SSN_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("[SSN]", "Security", "[SSN]= '" & Me![SSN] & "'")) Then
MsgBox "This SSN already exists."
Cancel = True
Me.Undo
DoCmd.GoToRecord , , acFirst
DoCmd.FindRecord SSN
End If
End Sub