السلام عليكم
اخوتي:
هذا كود:
Dim cnn As ADODB.Connection
Dim rst As New ADODB.Recordset
Set cnn = CurrentProject.Connection
rst.Open "mytable", cnn
With rst
.Find "criteria"
If Not (.EOF) Then
If MsgBox("record already exists" & vbCrLf & "Press 'OK' to return and enter a value." _
& vbCrLf & "Press 'Cancel' to abort the record.", vbOKCancel, "Name exists") = vbCancel Then
DoCmd.Close
End If
Else
MsgBox "No match found"
End If
End With
rst.Close
cnn.Close
Set rst = Nothing
Set cnn = Nothingاريد منكم شرحه والفائده منه
واين يوضع في اي حدث...لامكانية الاستفاده منه



