I used this code to highlight labels for check boxes on a form now I would like to do the same for my report, but I keep getting an error "You have an expression that has no Value" I know I'm probably not referencing the report controls correctly. Currently I'm using the on open event.
Any help will be appreciated. Thanks
Option Compare Database
Option Explicit
Const conHiOn As Long = 65535
Const conHiOff As Long = 16777215
Public Sub Cmd_HighLight()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acCheckBox Then
If ctl.Value Then
ctl.Controls(0).BackColor = conHiOn
Else
ctl.Controls(0).BackColor = conHiOff
End If
End If
Next ctl
End Sub
Any help will be appreciated. Thanks
Option Compare Database
Option Explicit
Const conHiOn As Long = 65535
Const conHiOff As Long = 16777215
Public Sub Cmd_HighLight()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acCheckBox Then
If ctl.Value Then
ctl.Controls(0).BackColor = conHiOn
Else
ctl.Controls(0).BackColor = conHiOff
End If
End If
Next ctl
End Sub