F
FlyingDragon via AccessMonster.com
hi all
I am new here and i hope to find what i looking for
i used the following code to prevent dublicates in my record SeqNum and it
works perfect
i want to rebuild this code to prevent dublicates in three records together
CrimeNum and CrimeYear and CrimeTypeID
Private Sub SeqNum_BeforeUpdate(Cancel As Integer)
Dim SID As String
Dim stLinkCriteria As String
Dim rsc As DAO.Recordset
Set rsc = Me.RecordsetClone
SID = Me.SeqNum.Value
stLinkCriteria = "[SeqNum]=" & " " & SID
If DCount("SeqNum", "Crimes", stLinkCriteria) > 0 Then
Me.Undo
MsgBox "MyMessage" _
& (SID) & " ............... " _
& vbCr & vbCr & "................................ ", vbInformation _
, "........................."
rsc.FindFirst stLinkCriteria
Me.Bookmark = rsc.Bookmark
End If
Set rsc = Nothing
End Sub
many thanks for all
sorry about my english
I am new here and i hope to find what i looking for
i used the following code to prevent dublicates in my record SeqNum and it
works perfect
i want to rebuild this code to prevent dublicates in three records together
CrimeNum and CrimeYear and CrimeTypeID
Private Sub SeqNum_BeforeUpdate(Cancel As Integer)
Dim SID As String
Dim stLinkCriteria As String
Dim rsc As DAO.Recordset
Set rsc = Me.RecordsetClone
SID = Me.SeqNum.Value
stLinkCriteria = "[SeqNum]=" & " " & SID
If DCount("SeqNum", "Crimes", stLinkCriteria) > 0 Then
Me.Undo
MsgBox "MyMessage" _
& (SID) & " ............... " _
& vbCr & vbCr & "................................ ", vbInformation _
, "........................."
rsc.FindFirst stLinkCriteria
Me.Bookmark = rsc.Bookmark
End If
Set rsc = Nothing
End Sub
many thanks for all
sorry about my english