I have the following :
Public Sub ObjectFormattin g(ByRef objTarget As Variant)
SetObjectBorder Width objTarget, IIf(HasFocus(ob jTarget), 2, 0)
End Sub
and
Function HasFocus(objCon trol As Control) As Boolean
If Screen.ActiveCo ntrol Is objControl Then
HasFocus = True
Else
HasFocus = False
End If
End Function
Both the Sub as the Function are in another module. The object provided to HasFocus resides on a SubForm
I always get an error 2474 (control must be in active window) on the Screen.ActiveCo ntrol
What am I overlooking ?
Thanks
Public Sub ObjectFormattin g(ByRef objTarget As Variant)
SetObjectBorder Width objTarget, IIf(HasFocus(ob jTarget), 2, 0)
End Sub
and
Function HasFocus(objCon trol As Control) As Boolean
If Screen.ActiveCo ntrol Is objControl Then
HasFocus = True
Else
HasFocus = False
End If
End Function
Both the Sub as the Function are in another module. The object provided to HasFocus resides on a SubForm
I always get an error 2474 (control must be in active window) on the Screen.ActiveCo ntrol
What am I overlooking ?
Thanks
Comment