In the code below, how do I identify the name of the current control in the loop ?
There are a couple of fields in the form that can be left blank. I would like to check if the blank controls are these fields before popping the message.
For Each ctl In frm.Controls
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Then
If IsNull(ctl) Then
MsgBox "Please complete form !", vbInformation
Exit For
Exit Sub
End If
End If
There are a couple of fields in the form that can be left blank. I would like to check if the blank controls are these fields before popping the message.
For Each ctl In frm.Controls
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Then
If IsNull(ctl) Then
MsgBox "Please complete form !", vbInformation
Exit For
Exit Sub
End If
End If