G
Guest
I have a questionnaire with many check boxes for collection y/n data. I
have a requirement to change the color of the label associated with the
check box if it is selected or unselected (exact colors don't). I want to
use a function that can be called whenever one of the controls of concern
are changed.
We use Windows 2k and Access97 with all service packs.
Sample of the on change event code for one of the check boxes:
Private Sub chkOne_AfterUpdate()
Dim strControlName As String
Dim bolSelected As Boolean
strControlName = "chkOne"
bolSelected = Me.chkOne
Call ChangeColor(strControlName, bolSelected)
End Sub
One of the experimental functions that is attempting to fulfill the
requirement which does not come close to working:
Function ChangeColor(strControlName As String, bolSelected As Boolean)
If bolSelected Then
Me." & strControlName & ".BackColor = vbYellow
Else
Me." & strControlName & ".BackColor = vbBlue
End If
End Function
Thanks for looking,
Bob
have a requirement to change the color of the label associated with the
check box if it is selected or unselected (exact colors don't). I want to
use a function that can be called whenever one of the controls of concern
are changed.
We use Windows 2k and Access97 with all service packs.
Sample of the on change event code for one of the check boxes:
Private Sub chkOne_AfterUpdate()
Dim strControlName As String
Dim bolSelected As Boolean
strControlName = "chkOne"
bolSelected = Me.chkOne
Call ChangeColor(strControlName, bolSelected)
End Sub
One of the experimental functions that is attempting to fulfill the
requirement which does not come close to working:
Function ChangeColor(strControlName As String, bolSelected As Boolean)
If bolSelected Then
Me." & strControlName & ".BackColor = vbYellow
Else
Me." & strControlName & ".BackColor = vbBlue
End If
End Function
Thanks for looking,
Bob