I have a report that I want to change any empty fields (textboxes) to have a
red background. I cannot seem to get backgound colors to work?
If I set conditional formatting on a value < 10 with text color changing it
seems to work.
Here's my 2 attempts:
Len([NumberOfReps])<1 Or IsNull([NumberOfReps]) ---set background to red
Then I tried this in the OnFormat event of the Detail section:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Not Len(Me.NumberofReps) >= 1 Then
Me.NumberofReps.BackColor = vbRed
End If
End Sub
Background colors don't seem to change???
chemicals - 13 Mar 2008 16:18 GMT
Never mind!!!
I had the textbox properties for BackStyle as Transparent instead of
Normal......Duh!
> I have a report that I want to change any empty fields (textboxes) to have a
> red background. I cannot seem to get backgound colors to work?
[quoted text clipped - 15 lines]
>
> Background colors don't seem to change???
Allen Browne - 13 Mar 2008 16:21 GMT
Assuming this is Access 2000 or later, you don't need any code. Just use
Conditional Formatting.
1. In report design view, select the NumberOfReps text box.
2. Choose Conditional Formatting on the Format menu.
3. Set Condition 1 to:
Expression: [NumberOfReps] Is Null
and choose the color in the bucket.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
>I have a report that I want to change any empty fields (textboxes) to have
>a
[quoted text clipped - 17 lines]
>
> Background colors don't seem to change???