I have the following code snippet that refuses to do as it is bid.
The idea is to catch an inadvertent "setfocus" to a control that already has focus.
From the screenshots it is obvious that the control name and the string "str" are the same yet the "Then" clause is still activated.
The idea is to catch an inadvertent "setfocus" to a control that already has focus.
From the screenshots it is obvious that the control name and the string "str" are the same yet the "Then" clause is still activated.
Code:
Private Sub isInFocus(str As String)
If Me.ActiveControl.Name <> str Then Me.Controls(str).SetFocus
End Sub