If IsNull(txt_TC_KİMLİK_NO) Then
Me.Undo
DoCmd.Close
Else
If MsgBox("Değişiklikler Kaydedilsin mi?", vbYesNo, "Kaydediliyor...") = vbYes Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
DoCmd.Close
Else
Me.Undo
DoCmd.Close
End If
End If
kodunu yaz.
Ayrıca, "txt_TC_KİMLİK_NO" Metin kutusunun çıkıldığında olayındaki kodu aşağıdaki ile değiştir.
Private Sub txt_TC_KİMLİK_NO_Exit(Cancel As Integer)
Dim var_mi As Byte
If IsNull(txt_TC_KİMLİK_NO) Then
Exit Sub
var_mi = DCount("TC_KİMLİK_NO", "KURULKARARI", "TC_KİMLİK_NO='" & Me.txt_TC_KİMLİK_NO & "'")
If var_mi > 0 Then
MsgBox "Bu TC Kimlik Numarası İle Daha Önce Kayıt Yapılmış. Kontrol Ediniz", vbCritical + vbOKOnly, "Mükerrer Kayıt"
Me.txt_TC_KİMLİK_NO = Empty
Me.txt_TC_KİMLİK_NO.SetFocus
Else
Me.Undo
End If
End If
End Sub