وهذه مشاركة مع اساتذتي الكرام ... مع التحية لهم جميعا .....
If DCount("*", "[Students]", "[ID]=" & Me.Text0) > 0 Then
Dim rst As DAO.Recordset
Dim fld As Field
Dim a As Integer
Set rst = CurrentDb.OpenRecordset("SELECT Students.ID, Students.Fullname, Students.tel, Students.Degree, Students.class " & _
"FROM Students " & _
"WHERE (((Students.ID)=" & [Forms]![Form]![Text0] & "));")
For a = 1 To rst.RecordCount
For Each fld In rst.Fields
If IsNull(fld.Value) Then
MsgBox "قم باكمال البيانات" & "(" & fld.Name & ")" & "ليس هناك بيانات في الحقل"
DoCmd.OpenQuery "استعلام1", acViewNormal
Exit Sub
End If
Next fld
rst.MoveNext
Next a
rst.Close: Set rst = Nothing
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO Team ( ID, Fullname, tel, Degree, class ) " & vbCrLf & _
"SELECT Students.ID, Students.Fullname, Students.tel, Students.Degree, Students.class " & vbCrLf & _
"FROM Students " & vbCrLf & _
"WHERE (((Students.ID)=[Forms]![Form]![Text0]));"
DoCmd.SetWarnings True
Me.Text0 = ""
Else
MsgBox "هذا القيد غير موجود"
End If
Me.Requery
Me.Text0 = Null
Me.Text0.SetFocus
Example.accdb