(16/10/2018, 21:55)ozanakkaya yazdı: Uygulamanızı inceleyemeyeceğim. Kullandığınız kodu yazın.
Bu kodu çalıştırdığımda başvuru sorgusu bozulup resimde görüldüğü şekle bürünüyor. Ben sorguyu tekrar düzeltip sonuçları göster dediğimde sorgu yine bozuluyor ve rapor boş bir şekilde ekrana geliyor.
Dim qdf2 As DAO.QueryDef
Set qdf2 = CurrentDb.QueryDefs("SRG_PORTFOY")
GSorgum = "SELECT * FROM TBL_PORTFOY"
If crc_musteritipi = 1 Then
strWhere = strWhere & "([musteritipi] = ""ALICI"") AND "
Else
strWhere = strWhere & "([musteritipi] = ""SATICI"") AND "
End If
Select Case crc_Kategori
Case 1
GKategori = "KONUT"
Case 2
GKategori = "İŞYERİ"
Case 3
GKategori = "ARSA"
End Select
strWhere = strWhere & "([Kategori] = """ & GKategori & """) AND "
Select Case crc_Tipi
Case 1
GTipi = "KİRALIK"
Case 2
GTipi = "SATILIK"
Case 3
GTipi = "DEVREN KİRALIK"
Case 4
GTipi = "DEVREN SATILIK"
End Select
strWhere = strWhere & "([Tipi] = """ & GTipi & """) AND "
If Not IsNull(Me.mtn_lokasyon) Then
strWhere = strWhere & "((lokasyon1 Like '*" & Me.mtn_lokasyon & "*') or (lokasyon2 Like '*" & Me.mtn_lokasyon & "*') OR (lokasyon3 Like '*" & Me.mtn_lokasyon & "*')) AND "
End If
If Me.esyali = 0 Then
strWhere = strWhere & "([esyali] = 0) AND "
Else
strWhere = strWhere & "([esyali] = -1) AND "
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "No criteria", vbInformation, "Nothing to do."
Else
strWhere = Left$(strWhere, lngLen)
GSorguTamami = GSorgum & " where " & strWhere
End If
Me.mtn_sorgu = GSorguTamami
qdf2.SQL = GSorguTamami
DoCmd.OpenReport "R_002_PORTFOY", acViewPreview, , , acWindowNormal
End Sub