Hi, I need help writing code to highlight a label when a checkbox is checked. I want o be able to call this procedure so I don't have to code it a 100 times. Here’s what I have so far but I know its wrong. Any help will be greatly appreciated. Thanks
Option Compare Database
Option Explicit
Const conHiOn As Long = 65535
Const conHiOff As Long = -2147483633
Public Sub Cmd_HighLight()
Dim ctl As Control
For Each ctl In Controls
If Me.ctl.ControlType = acCheckBox = True Then
If Me.ctl.ControlType = acLabel Then
ctl.BackColor = conHiOn
Else
ctl.BackColor = conHiOff
End If
End If
Next ctl
End Sub
Option Compare Database
Option Explicit
Const conHiOn As Long = 65535
Const conHiOff As Long = -2147483633
Public Sub Cmd_HighLight()
Dim ctl As Control
For Each ctl In Controls
If Me.ctl.ControlType = acCheckBox = True Then
If Me.ctl.ControlType = acLabel Then
ctl.BackColor = conHiOn
Else
ctl.BackColor = conHiOff
End If
End If
Next ctl
End Sub