I have a Report from Cross-Tab Query in which I would like to Highlight the Whole Columns conditionally (Details Sections) according to the certain prio-conditions.
The fields are: Field1, Field2, Field3, Field4, Field5...Field30.
I have tried to set the Conditional Formatting for Each Fields as on the Details Section of the ReportDesinView. On the Property Sheet of a Report, I have selected the DetailsSection and then Set the On Paint Property the following Code!
Expand|Select|Wrap|Line Numbers
- Private Sub Detail_Paint()
- If Me!Field1.Value<175 Then
- Me!Field1.BackColor = vbBlack
- End If
- If Me!Field2.Value < 175 Then
- Me!Field2.BackColor = vbBlack
- End If
- ...
- End Sub
QUESTION:
How to set this Conditional Formatting Dynamic, wont depends on FieldNames.
ie. I want to use the same code to apply to different fieldnames say FieldN0,FieldN1,FieldN2,FieldN3 ... Without explicity Entering fieldNames