Help!
I have a form with eight optiongroups and want to loop through them to pick up the optionvalue of each so I can change their bordercolor - if an optionvalue >0 to black, and if no optionvalue (ie =0) to red so the user knows they must tick a box within that optiongroup.
The form is designed for children to look at an image and to assign an emotion to that image and then to say how sure they are of their choice (this for my wife's PhD work!).
The code I have written is as follows:
which I was going to call from each of the optiongroups when an "on_click" action takes place.
The code is hanging at the line "If ChangeableLabels(x).OptionValue > 0 Then" with the error message "Runtime Error 13, Type Mismatch".
I can't for the life of me understand why.
Can someone please help a relative newcomer to Access coding?
Thanks in advance.
I have a form with eight optiongroups and want to loop through them to pick up the optionvalue of each so I can change their bordercolor - if an optionvalue >0 to black, and if no optionvalue (ie =0) to red so the user knows they must tick a box within that optiongroup.
The form is designed for children to look at an image and to assign an emotion to that image and then to say how sure they are of their choice (this for my wife's PhD work!).
The code I have written is as follows:
Code:
Private Sub optgrpWhiteGirl1_Click()
Dim ChangeableLabels As Variant
ChangeableLabels = OptionGroup
ChangeableLabels = Array("optgrpWhiteGirl1", "optgrpWhiteGirl1Sure", _
"optgrpBlackGirl2", "optgrpBlackGirl2Sure", "optgrpWhiteBoy3", _
"optgrpWhiteBoy3Sure", "optgrpBlackBoy4", "optgrpBlackBoy4Sure")
For Each x In ChangeableLabels
If ChangeableLabels(x).OptionValue > 0 Then
ChangeableLabels(x).BorderColor = 0
ElseIf ChangeableLabels(x).OptionValue = 0 Then
ChangeableLabels(x).BorderColor = 255
End If
Next
which I was going to call from each of the optiongroups when an "on_click" action takes place.
The code is hanging at the line "If ChangeableLabels(x).OptionValue > 0 Then" with the error message "Runtime Error 13, Type Mismatch".
I can't for the life of me understand why.
Can someone please help a relative newcomer to Access coding?
Thanks in advance.