I need to format about 20 check boxes on a form so the user can see easily when each has the focus, I’ve applied (and removed) a bold drop shadow using the got focus/lost focus events but was wondering if I could wrap the code in a separate sub so I can re-use it for all the check boxes (and no-doubt easily change the color when someone doesn’t like it).
Here’s the simple code so far
Private Sub chkQuestion1_GotFocus()
With chkQuestion1
.SpecialEffect = 4
.BorderWidth = 3
.BorderColor = RGB(176, 255, 184)
End With
End Sub
Private Sub chkQuestion1_LostFocus()
With chkQuestion1
.SpecialEffect = 0
.BorderWidth = 0
.BorderColor = RGB(176, 255, 184)
End With
End Sub
Instead, I wanted to pass the control name to another sub and use after the ‘With’ word but couldn’t get it to work. Any ideas?