بعتذر عن الخطاء غير المقصود اتفضل هذا مجرب
الاول لم اجربه هههههههههه
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO qard_Finished ( id, site_ID, total, sadad_1, dat_1, SN, 7ala ) " & vbCrLf & _
"SELECT qard.id, qard.site_ID, qard.total, qard.sadad_1, qard.dat_1, qard.SN, ""تم السداد"" AS Expr1 " & vbCrLf & _
"FROM qard " & vbCrLf & _
"GROUP BY qard.id, qard.site_ID, qard.total, qard.sadad_1, qard.dat_1, qard.SN, ""تم السداد"" " & vbCrLf & _
"HAVING (((Nz(DSum(""total"",""qard"","" site_ID="" & [site_ID])))=Nz(DSum(""sadad_1"",""qard"","" site_ID="" & [site_ID]))));"
DoCmd.RunSQL "DELETE qard.id, qard.site_ID, qard.total, qard.sadad_1, qard.dat_1, qard.SN, ""تم السداد"" AS Expr1, Nz(DSum(""total"",""qard"","" site_ID="" & [site_ID])) AS Expr2 " & vbCrLf & _
"FROM qard " & vbCrLf & _
"WHERE (((Nz(DSum(""total"",""qard"","" site_ID="" & [site_ID])))=Nz(DSum(""sadad_1"",""qard"","" site_ID="" & [site_ID]))));"
MsgBox "تم الترحيل بنجاح", vbInformation, "تنبيه"
DoCmd.SetWarnings True
0002.rar