Private Sub Komut84_Click()
On Error Resume Next
Const SQLA As String = "SELECT Excel.[NO], Excel.[MÜŞTEKİ ADI SOYADI], Excel.SUÇU, Excel.[HAZIRLIK TARİHİ], Excel.[HAZIRLIK YILI], Excel.[HAZIRLIK NUMARASI] FROM Excel LEFT JOIN Veriler ON (Excel.[MÜŞTEKİ ADI SOYADI] = Veriler.MÜŞTEKİ) AND (Excel.[HAZIRLIK TARİHİ] = Veriler.CHAZTR) AND (Excel.[HAZIRLIK NUMARASI] = Veriler.CHAZNO) WHERE (((Veriler.MÜŞTEKİ) Is Null) AND ((Veriler.CHAZTR) Is Null) AND ((Veriler.CHAZNO) Is Null))"
Dim SrgYp As QueryDef
DoCmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel12, "Excel", CurrentProject.Path & "\VeriAl.xlsx", True
CurrentDb.Execute "INSERT INTO Veriler ( ExcelNu, MÜŞTEKİ, SUÇ, CHAZTR, CHAZYIL, CHAZNO ) " & _
"SELECT Excel.[NO], Excel.[MÜŞTEKİ ADI SOYADI], Excel.SUÇU, Excel.[HAZIRLIK TARİHİ], Excel.[HAZIRLIK YILI], Excel.[HAZIRLIK NUMARASI] FROM Excel LEFT JOIN Veriler ON (Excel.[HAZIRLIK NUMARASI] = Veriler.CHAZNO) AND (Excel.[HAZIRLIK TARİHİ] = Veriler.CHAZTR) AND (Excel.[MÜŞTEKİ ADI SOYADI] = Veriler.MÜŞTEKİ) WHERE (((Veriler.MÜŞTEKİ) Is Null) AND ((Veriler.CHAZTR) Is Null) AND ((Veriler.CHAZNO) Is Null))"
Set SrgYp = CurrentDb.CreateQueryDef("Gecici", SQLA)
DoCmd.OutputTo acOutputQuery, "Gecici", acFormatXLSX, CurrentProject.Path & "\Yuklenmeyenler.xlsx", True
DoCmd.DeleteObject acQuery, "Gecici"
DoCmd.DeleteObject acTable, "Excel"
End Sub