Dim dbc As Database
Set dbc = CurrentDb
Dim cs As Recordset
Set cs = dbc.OpenRecordset("min", DB_OPEN_TABLE)
cs.Index = "primarykey"
Dim ifst As Boolean
ifst = (IsNull(Me![ye]) Or IsNull(Me![mon]) Or IsNull(Me![gov]) Or IsNull(Me![dist]) Or IsNull(Me![es]) Or IsNull(Me![ms]) Or IsNull(Me![itcode]) Or IsNull(Me![est]) Or IsNull(Me![am]) Or IsNull(Me![dt]) Or IsNull(Me![nm]))
If ifst = True Then
DoCmd.CancelEvent
MsgBox "áÇíãßä ÍÝÙ ÇáÓÌáÇÊ ÝÇÑÛÉ"
Else
cs.Seek "=", [ye], [mon], [gov], [dist], [es], [ms]
If cs.NoMatch Then
cs.AddNew
cs![ye] = Me![ye]
cs![mon] = Me![mon]
cs![gov] = Me![gov]
cs![dist] = Me![dist]
cs![es] = Me![es]
cs![ms] = Me![ms]
cs![itcode] = Me![itcode]
cs![est] = Me![est]
cs![am] = Me![am]
cs![dt] = Me![dt]
cs![nm] = Me![nm]
cs.Update
MsgBox ("Êã ÇáÍÝÙ ÈäÌÇÍ")
cs.close
DoCmd.GoToControl ("ms")
Else
cs.delete
cs.AddNew
cs![ye] = Me![ye]
cs![mon] = Me![mon]
cs![gov] = Me![gov]
cs![dist] = Me![dist]
cs![es] = Me![es]
cs![ms] = Me![ms]
cs![itcode] = Me![itcode]
cs![est] = Me![est]
cs![am] = Me![am]
cs![dt] = Me![dt]
cs![nm] = Me![nm]
cs.Update
MsgBox ("Êã ÇáÊÍÏíË ÈäÌÇÍ")
DoCmd.GoToControl ("ms")
End If
End If
Me![itcode] = Null
Me![est] = Null
Me![am] = Null
Me![ms] = Null
Me![nm] = Null
هادا كود الحفظ بس المشكلة اتحلت لان انا عندي عمودين تسلسل مش عمود واحد وضفت العمودين اشتغل بشكل صحيح شكرا ليك ولاهتمامك