لقيت هذا الكود في احد المواقع الاجنبية
يعمل لوب على كل كنترول موجود على الفروم
و اذا مربع نص يتاكد منه انه مش فاضي
اعتقد راح ينفع
Dim ctl As Control
For Each ctl In Controls
If TypeOf ctl Is TextBox Or ComboBox Then
If Len(Nz(ctl.Value)) = 0 Then
MsgBox "please enter data " & ctl.name
Exit For
End If
End If
Next ctl
For Each ctl In Controls
If TypeOf ctl Is ComboBox Then
If Len(Nz(ctl.Value)) = 0 Then
MsgBox "please enter data " & ctl.name
Exit For
End If
End If
Next ctl