I have the following :
Public Sub ObjectFormatting(ByRef objTarget As Variant)
SetObjectBorderWidth objTarget, IIf(HasFocus(objTarget), 2, 0)
End Sub
and
Function HasFocus(objControl As Control) As Boolean
If Screen.ActiveControl 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.ActiveControl
What am I overlooking ?
Thanks