Try the following version of the Highlight_Control procedure. When calling it, you will need to include both the OptionButton and the Frame as parameters.
e.g.
VB Code:
Private Sub OptionButton1_Click() Highlight_Control Me.OptionButton1, Me.Frame1 End Sub
Here's the revised procedure.
VB Code:
Private Sub Highlight_Control(ByRef MarkControl As Control, ByRef OptFrame As Control) Dim cMyControl As Control If TypeName(OptFrame) <> "Frame" _ Or TypeName(MarkControl) <> "OptionButton" Then Exit Sub End If For Each cMyControl In OptFrame.Controls If TypeName(cMyControl) = "OptionButton" Then With cMyControl .BackColor = 10931133 .ForeColor = &H4080& End With End If Next cMyControl With MarkControl .BackColor = &HC0FFFF .ForeColor = &HFF0000 End With End Sub




Reply With Quote