Just to follow up on my post #12 heres what using a select case to include a listbox could look like. You could combine the textbox and combobox case if you wanted. It also tests for a label and uses the controlsource if there is no label.
Code:
Public Function InValidForm(frm As Form, TagChar As String) As Boolean
Dim ctl As Control
Dim strMsg As String
For Each ctl In frm.Controls
If InStr(1, ctl.Tag, TagChar) Then
Select Case ctl.ControlType
Case 109 'acTextBox
If Nz(ctl, "") = "" Then
strMsg = strMsg & IIf(ctl.Controls.Count <> 0, ctl.Controls.Item(0).Caption, ctl.ControlSource) & vbNewLine
ctl.BorderColor = vbRed
InValidForm = True
Else
ctl.BorderColor = vbBlack
End If
Case 110 'acListBox
If ctl.ItemsSelected.Count = 0 Then
strMsg = strMsg & IIf(ctl.Controls.Count <> 0, ctl.Controls.Item(0).Caption, ctl.ControlSource) & vbNewLine
ctl.BorderColor = vbRed
InValidForm = True
Else
ctl.BorderColor = vbBlack
End If
Case 111 'acComboBox
If Nz(ctl, "") = "" Then
strMsg = strMsg & IIf(ctl.Controls.Count <> 0, ctl.Controls.Item(0).Caption, ctl.ControlSource) & vbNewLine
ctl.BorderColor = vbRed
InValidForm = True
Else
ctl.BorderColor = vbBlack
End If
Case Else
Debug.Print ctl.ControlType
End Select
End If
Next
If InValidForm Then MsgBox strMsg
End Function