I am trying to learn about how to set background colors of controls in a report in Access 2003. I can not make a programmatic setting of the BackColor property to work for anything except whole sections (last line when uncommented). I'm a newbie to access and vba so I'm sure I'm just missing something fundamental. Following is code in the reports Detail_Format event handler that I'm puzzled over. The Messages confirm that the property is being set on the controls but the background color is not changing.
(BTW, don't try the following code on a report with a lot of details or the message will go off for each detail
Thanks for any help.
Dim cCont As Control
Dim sM As String
Dim headingBGColor As Long
headingBGColor = 8404992
For Each cCont In Me.Section(acDetail).Controls
sM = sM & " " & TypeName(cCont)
If TypeName(cCont) = "Textbox" Then
cCont.BackColor = headingBGColor
sM = sM & "(" & CStr(cCont.Name) & ": " & CStr(cCont.BackColor) & ")"
End If
Next cCont
MsgBox (sM)
' Try a few direct property sets and they dont work either
Me.tbTBD.BackColor = headingBGColor
Me.Low.BackColor = headingBGColor
Me.Label29.BackColor = headingBGColor
'Me.Section(acDetail).BackColor = headingBGColor