Forum Discussion
Text Box Conditional Formatting
- Jul 23, 2024
There are many ways to archive this, but conditional formatting is fine.
I assume you have copied all desired formatting from the text field Question001 (or similar) to the other text fields named Question plus a number. (Double click on the brush in the ribbon enables multiple copies.)The combo boxes Answer001 to Answer100 (or similar) must also exist in the same form "Audit_Results".
Then you can correct the missaligned conditional format expressions per code:
E.g:Private Sub C_F_Expr_Modify() Dim i As Long, j As Long For i = 2 To 100 With Forms!Audit_Results!Controls("Question" & Format$(i, "000")) For j = 0 To 4 .FormatConditions(j).Modify Type:=acExpression, Operator:=acEqual, Expression1:=Replace(.FormatConditions(j).Expression1, "001", Format$(i, "000")) Next j End With Next i End Sub
There are many ways to archive this, but conditional formatting is fine.
I assume you have copied all desired formatting from the text field Question001 (or similar) to the other text fields named Question plus a number. (Double click on the brush in the ribbon enables multiple copies.)
The combo boxes Answer001 to Answer100 (or similar) must also exist in the same form "Audit_Results".
Then you can correct the missaligned conditional format expressions per code:
E.g:
Private Sub C_F_Expr_Modify()
Dim i As Long, j As Long
For i = 2 To 100
With Forms!Audit_Results!Controls("Question" & Format$(i, "000"))
For j = 0 To 4
.FormatConditions(j).Modify Type:=acExpression, Operator:=acEqual, Expression1:=Replace(.FormatConditions(j).Expression1, "001", Format$(i, "000"))
Next j
End With
Next i
End Sub