وعليكم السلام ورحمة الله وبركاته
تفضل اخي الكريم
If IsNull([txtName]) Then
MsgBox "يحب اختيار اسم العميل اولاً", vbInformation, "officena"
DoCmd.GoToControl "txtName"
Else
If IsNull([txtTel]) Then
MsgBox "يحب اختياررقم التليفون اولاً", vbInformation, "officena"
DoCmd.GoToControl "txtTel"
Else
If IsNull([txtAddress]) Then
MsgBox "يحب اختيار العنوان اولاً", vbInformation, "officena"
DoCmd.GoToControl "txtAddress"
Else
Dim db As DAO.Database
Dim Rs As DAO.Recordset
Set db = CurrentDb
Set Rs = db.OpenRecordset("SELECT tbl1.*FROM tbl1;")
Rs.AddNew
Rs("XName") = Me.txtName
Rs("XTel") = Me.txtTel
Rs("XAddress") = Me.txtAddress
Rs.Update
Rs.Close
MsgBox "تم اضافة البيانات بنجاح ان شاء الله ", vbInformation + vbOKOnly, "officena"
DoCmd.Close
End If
End If
End If
علمأ بأن حقل كود العميل تلقائي اذن لا يمكن اضافته بهذه الطريقة وستكون اضافته تلقائية
DB_test.rar
تحياتي