بارك الله فيك معلمى الفاضل
Private Sub ÃãÑ17_Click()
If MsgBox("åá ÊÑíÏ ÍÞÇð ÊÑÍíá ÇáÍÓÇÈÇÊ", _
vbQuestion + vbYesNo + vbMsgBoxRight + vbDefaultButton2, _
"ÊÃßíÏ ÇáÊÑÍíá") = vbYes Then
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
End If
End Sub
هل هكذا صحيح ام لا