'---------------------------------------------------------------------------------------
' Procedure : CheckForConditionalFormat
' Author : mellon
' Date : 04/02/2016
' Purpose : This routine will iterate over AllForms and identify those Forms and Control(s)
' that have Conditional Formatting and list the info to the immediate window.
'---------------------------------------------------------------------------------------
'
Sub CheckForConditionalFormat()
Dim objAccObj As AccessObject
Dim objForm As Object
Dim strForm As String
Dim ctl As Control
Dim objActiveForm As Form
Dim DB As DAO.Database
10 On Error GoTo CheckForConditionalFormat_Error
20 Set DB = CurrentDb
30 Set objForm = Application.CurrentProject
40 For Each objAccObj In objForm.AllForms
50 strForm = objAccObj.name
60 DoCmd.OpenForm strForm, acDesign
70 Set objActiveForm = Application.Screen.ActiveForm
80 For Each ctl In objActiveForm.Controls
90 If (ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox) Then
100 If ctl.FormatConditions.Count > 0 Then
110 Debug.Print strForm & " " & ctl.name & " has ConditionalFormat"
120 End If
130 End If
140 Next ctl
150 DoCmd.Close acForm, strForm
160 Next objAccObj
200 On Error GoTo 0
210 Exit Sub
CheckForConditionalFormat_Error:
220 MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure CheckForConditionalFormat of Module ModuleTesting_CanKill"
End Sub