انا عملت اللي ممكن اقدر عليه في الكود ، جربه واخبرنا لو سمحت
Function IsAutoNumber2()
'DoCmd.SetWarnings False
Dim n, f, D, E, L, t, h, G As Integer
Dim rst As DAO.Recordset
Dim bb As Integer
' Dim i As Integer, RC As Integer
' Set rst = CurrentDb.OpenRecordset("SELECT * FROM [اقمشة]")
' rst.MoveLast: rst.MoveFirst
' RC = rst.RecordCount
' For i = 1 To RC
Set rst = CurrentDb.OpenRecordset("SELECT komash, qunt4 FROM [اقمشة]")
Do While Not rst.EOF
rst.Edit
n = Nz(DSum("[quntt]", "Data", "komash='" & rst!komash & "'"), 0)
f = Nz(DSum("[quntt1]", "Data", "komash1='" & rst!komash & "'"), 0)
D = Nz(DSum("[quntt2]", "Data", "komash2='" & rst!komash & "'"), 0)
E = Nz(DSum("[quntt3]", "Data", "komash3='" & rst!komash & "'"), 0)
L = Nz(DSum("[quntt4]", "Data", "komash4='" & rst!komash & "'"), 0)
t = Nz(DSum("[quntt5]", "Data", "komash5='" & rst!komash & "'"), 0)
h = Nz(DSum("[quntt6]", "Data", "komash6='" & rst!komash & "'"), 0)
G = Nz(DSum("[quntt7]", "Data", "komash7='" & rst!komash & "'"), 0)
rst("qunt4").Value = n + f + D + E + L + t + h + G
rst.Update
rst.MoveNext
Loop
' Next i
rst.Close: Set rst = Nothing
MsgBox " تم تعديل السجلات في الجدول بنجاح ", vbInformation, "تنبيه"
'DoCmd.SetWarnings True
End Function
جعفر