sadece If DCount("*", "gecici", "veritipi<>" & x) > 0 Then MsgBox " veri tipi farklı": Exit Sub satırı eklendi
Private Sub Komut10_Click()
Sayi = ""
Dim varItm As Variant
For Each varItm In Me.Liste8.ItemsSelected
x = CLng(Me.Liste8.Column(3, varItm))
If Sayi = "" Then Sayi = x 'Else Exit Sub
If Sayi <> "" Then
If Sayi = x Then
Sayi = x
Else
MsgBox "tipler farklı"
Exit Sub
End If
End If
10
Next varItm
If DCount("*", "gecici", "veritipi<>" & x) > 0 Then MsgBox " veri tipi farklı": Exit Sub '<<== eklenen satır
For Each varItm In Me.Liste8.ItemsSelected
CurrentDb.Execute "INSERT INTO gecici (sipno, kg, veritipi) VALUES(" & Me.Liste8.Column(0, varItm) & ", " & Me.Liste8.Column(1, varItm) & ", " & CLng(Me.Liste8.Column(3, varItm)) & ")"
Next varItm
Me.Liste11.Requery
End Sub