Skip to main content

AccessTr.neT


Dcount İle Aynı Kişi Varsa Eklenmesin

Dcount İle Aynı Kişi Varsa Eklenmesin

#63

Gogrnoid = Forms![frm_goruskisiler]!mtn_ogrenciid
Gogrid = Forms![frm_goruskisiler]![ogrenciler].Form![ogr_id]

For Each GItem In Me.listekisiler.ItemsSelected
Gadsoyad = Me.listekisiler.Column(1, GItem)
Gogrno = Me.listekisiler.Column(0, GItem)
Next GItem


Select Case cercevesecim
Case 1

If DCount("gorus_id", "tbl_gorusler", "[olay_id] = " & olay_is_no & " And [ogrenci_id]= " & Gogrnoid & " And [ogretmen_id]= " & Gogrno) <> 0 Then

        MsgBox (Gadsoyad & " İsimli Öğretmen Daha Önce Eklenmiş !")
    Else
        DoCmd.SetWarnings False
        Forms![frm_goruskisiler]![frm_gorusu_alinanlar].Form.Requery
        DoCmd.RunSQL "INSERT INTO tbl_gorusler (ogrenci_id,olay_id,adi_soyadi,ogretmen_id,kim) VALUES ('" & Gogrnoid & "',' " & olay_is_no & "','" & Gadsoyad & "',' " & Gogrno & "','Öğretmen')"
        DoCmd.SetWarnings True
    End If


Me.frm_gorusu_alinanlar.Requery
Case 2

If DCount("gorus_id", "tbl_gorusler", "[olay_id] = " & olay_is_no & " And [ogrenci_id]= " & Gogrnoid & " And [ogretmen_id]= " & Gogrno) <> 0 Then
MsgBox (Gadsoyad & " İsimli Rehber Öğretmen Daha Önce Eklenmiş !")
    Else
        DoCmd.SetWarnings False
        Forms![frm_goruskisiler]![frm_gorusu_alinanlar].Form.Requery
        DoCmd.RunSQL "INSERT INTO tbl_gorusler (ogrenci_id,olay_id,adi_soyadi,ogretmen_id,kim) VALUES ('" & Gogrnoid & "',' " & olay_is_no & "','" & Gadsoyad & "',' " & Gogrno & "','Rehber Öğretmen')"
        DoCmd.SetWarnings True
    End If
Me.frm_gorusu_alinanlar.Requery
Case 3

If DCount("gorus_id", "tbl_gorusler", "[olay_id] = " & olay_is_no & " And [ogrenci_id]= " & Gogrnoid & " And [ogretmen_id]= " & Gogrno) <> 0 Then
MsgBox (Gadsoyad & " İsimli Sınıf Öğretmeni Daha Önce Eklenmiş !")
    Else
        DoCmd.SetWarnings False
        Forms![frm_goruskisiler]![frm_gorusu_alinanlar].Form.Requery
        DoCmd.RunSQL "INSERT INTO tbl_gorusler (ogrenci_id,olay_id,adi_soyadi,ogretmen_id,kim) VALUES (' " & [Gogrnoid] & "',' " & olay_is_no & "','" & Gadsoyad & "',' " & Gogrno & "','Sınıf Öğretmeni')"
        DoCmd.SetWarnings True
    End If

Me.frm_gorusu_alinanlar.Requery
Case 4

If DCount("gorus_id", "tbl_gorusler", "[olay_id] = " & olay_is_no & " And [ogrenci_id]= " & Gogrnoid & " And [adi_soyadi]= '" & Gadsoyad & "'") <> 0 Then

MsgBox (Gadsoyad & " İsimli Veli Daha Önce Eklenmiş !")

Else
        DoCmd.SetWarnings False
        Forms![frm_goruskisiler]![frm_gorusu_alinanlar].Form.Requery
        DoCmd.RunSQL "INSERT INTO tbl_gorusler (ogrenci_id,olay_id,adi_soyadi,kim) VALUES (' " & [Gogrnoid] & "',' " & olay_is_no & "','" & Gadsoyad & "','Veli' )"
        DoCmd.SetWarnings True
End If

Me.frm_gorusu_alinanlar.Requery


End Select


bu kodu test edin.
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
RE: Dcount İle Aynı Kişi Varsa Eklenmesin - Yazar: ozanakkaya - 10/04/2020, 12:08
Task