Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB report control question 1

Status
Not open for further replies.

JOD59

Technical User
Dec 17, 2003
39
US
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
 
You'll need to use the on format event of the section (detail?) where the controls reside.

Roy-Vidar
 
Thanks Roy, you're the best!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top