Sub snoopFormatConditions()
Set frm = Forms("frmTrailerDispatch")
For i = 0 To frm.Controls.Count - 1
Set ctl = frm.Controls(i)
With ctl
Debug.print
"--------------------------------------------------------------"
Debug.Print .Name, .ControlType
If .ControlType = acComboBox Or .ControlType = acTextBox Then
For j = 0 To .FormatConditions.Count - 1
Debug.Print .FormatConditions(j).Expression1
Debug.Print .FormatConditions(j).Expression2
Debug.Print .FormatConditions(j).Enabled
Debug.Print .FormatConditions(j).ForeColor
Debug.Print .FormatConditions(j).BackColor
Next j
End If
End With
Next i
Set frm = Nothing
End Sub
For the code to work, you'll need to have the form open as if you're
adding/editing records. There are several properties invovled as well such as
..Enabled, .BackColor, .ForeColor and I think two others. Check VBA Help under
FormatCondition Object for the specifics.