How do i know when a control has focus?

gbil

Registered User.
Local time
Yesterday, 19:43
Joined
Aug 30, 2013
Messages
26
hello.

in the following code, i am trying to determine if command button has the focus:

Private Sub lstOrg_LostFocus()
If Me.cmdEditOrgProfile_GotFocus() Then
Exit Sub
Else
Me.cmdEditOrgProfile.Enabled = False
End If

End Sub

the second line returns error.

how would i know if a control has the focus? google search does not return the answer i am seeking :(
 
The code to determine if a control has focus is along the lines of:

If Me.ActiveControl.Name = "CommandButtonName" Then
End If

Hope this helps ^_^
 
Chrafangau:

thank you.

using the me.activecontrol.name in immediate window, i realized my concept on object events is screwed.

again thank u.
 

Users who are viewing this thread

Back
Top Bottom