Artık bu gazdan sonra bakmasak olmaz
Allahtan kodunuz karışık değilmiş
Verdiği hata şu; Sayısal bir alana, metin olarak kriter koyamazsınız.
[birim.birimkod], [ünvan.ünkod], [konu.konukod] adındaki sayı alanlarını metin bir alanla kontrol ettirmişsiniz, aslında
[birim.birim], [ünvan.ünvan], [konu.konu] alanlarını kontrol etmelisiniz.
Bunun için Yazdır komutundaki ilgili kodları aşağıdaki şekilde değiştirin.
Kod:
If Not flgSelectAll Then strWhere = " WHERE (((toplantı.tarih)>=[Forms]![suz]![tarih1] And (toplantı.tarih)<=[Forms]![suz]![tarih2])) and ([birim.birim] in (" & Left(strIN, Len(strIN) - 1) & ")) "
If Not flgSelectAllx Then strWhere = " WHERE (((toplantı.tarih)>=[Forms]![suz]![tarih1] And (toplantı.tarih)<=[Forms]![suz]![tarih2])) and ([ünvan.ünvan] in (" & Left(strINx, Len(strINx) - 1) & "))) "
If Not flgSelectAllxx Then strWhere = " WHERE (((toplantı.tarih)>=[Forms]![suz]![tarih1] And (toplantı.tarih)<=[Forms]![suz]![tarih2])) and ([konu.konu] in (" & Left(strINxx, Len(strINxx) - 1) & "))) "
If Not flgSelectAll And Not flgSelectAllx Then strWhere = " WHERE (((toplantı.tarih)>=[Forms]![suz]![tarih1] And (toplantı.tarih)<=[Forms]![suz]![tarih2])) and ([birim.birim] in (" & Left(strIN, Len(strIN) - 1) & ")) and ([ünvan.ünvan] in (" & Left(strINx, Len(strINx) - 1) & "))) "
If Not flgSelectAll And Not flgSelectAllxx Then strWhere = " WHERE (((toplantı.tarih)>=[Forms]![suz]![tarih1] And (toplantı.tarih)<=[Forms]![suz]![tarih2])) and ([birim.birim] in (" & Left(strIN, Len(strIN) - 1) & ")) and ([konu.konu] in (" & Left(strINxx, Len(strINxx) - 1) & "))) "
If Not flgSelectAllx And Not flgSelectAllxx Then strWhere = " WHERE (((toplantı.tarih)>=[Forms]![suz]![tarih1] And (toplantı.tarih)<=[Forms]![suz]![tarih2])) and ([ünvan.ünvan] in (" & Left(strINx, Len(strINx) - 1) & ")) and ([konu.konu] in (" & Left(strINxx, Len(strINxx) - 1) & "))) "
If Not flgSelectAll And Not flgSelectAllx And Not flgSelectAllxx Then strWhere = " WHERE (((toplantı.tarih)>=[Forms]![suz]![tarih1] And (toplantı.tarih)<=[Forms]![suz]![tarih2])) and ([birim.birim] in (" & Left(strIN, Len(strIN) - 1) & ")) and ([ünvan.ünvan] in (" & Left(strINx, Len(strINx) - 1) & ")) and ([konu.konu] in (" & Left(strINxx, Len(strINxx) - 1) & ")))"
Burada Listbox'larda görünen isimleri değil, id alanlarını In kriterine ekliyor,
böylece sayı alanlarını ait olduğu sayı alanlarıyla kontrol etmiş oluyorsunuz.
Bence bu yöntem daha iyidir.
Kod:
'-----------------------------------------------
'Build the IN string by looping through the listbox
For I = 0 To birliste.ListCount - 1
If birliste.Selected(I) Then
If birliste.Column(1, I) = "<TÜMÜ>" Then
flgSelectAll = True
End If
strIN = strIN & birliste.Column(0, I) & ","
End If
Next I
'--------------------------------------------------------
'Build the IN string by looping through the listbox
For I = 0 To ünliste.ListCount - 1
If ünliste.Selected(I) Then
If ünliste.Column(1, I) = "<TÜMÜ>" Then
flgSelectAllx = True
End If
strINx = strINx & ünliste.Column(0, I) & ","
End If
Next I
'--------------------------------------------------------
'Build the IN string by looping through the listbox
For I = 0 To Liste2.ListCount - 1
If Liste2.Selected(I) Then
If Liste2.Column(1, I) = "<TÜMÜ>" Then
flgSelectAllxx = True
End If
strINxx = strINxx & Liste2.Column(0, I) & ","
End If
Next I
'-----------------------------------------------------------