تفضل هذا الكود
Dim msg1, msg2 As String
msg2 = "عزيزي المستخدم " & vbNewLine & "يرجى تعبئة الحقل / الحقول الفارغة"
Dim ctl As Control
For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Then
If IsNull(ctl) Or ctl = "" Then
If msg1 = "" Then
msg1 = " - " & ctl.Name
Else
msg1 = msg1 & vbNewLine & " - " & ctl.Name
End If
End If
End If
Next ctl
If msg1 = "" Then
DoCmd.RunCommand acCmdSaveRecord
MsgBox "تم الحفظ بنجاح", vbInformation, "تأكيد"
Else
MsgBox msg2 & vbNewLine & msg1, vbCritical, "تنبيه بوجود حقول فراغة"
End If