xenium
asked on
Detect if tab has focus
Hi,
how can i detect if a tab (or any other object) has the focus?
I can set the focus like this : Forms![Main]![&Fields].Set Focus
but instead i want to detect if it has the focus.
Thanks
how can i detect if a tab (or any other object) has the focus?
I can set the focus like this : Forms![Main]![&Fields].Set
but instead i want to detect if it has the focus.
Thanks
Have you considered storing a valiable on the click event of the tabs?
To find which control has focus use: Forms!FormName.ActiveContr ol.Name
You can use then in a If:Then statement to check your tab.
Dim ActiveCTL as Control
ActiveCTL = Forms!FormName.ActiveContr ol.Name
If YourControl = ActiveCTL then
' Do something if True
Else
' Do something if False
End If
I'll have to check this out tomorrow morning as I typing on the fly (dangerous for me), but think I'm in the BallPark...
Imoutwest
You can use then in a If:Then statement to check your tab.
Dim ActiveCTL as Control
ActiveCTL = Forms!FormName.ActiveContr
If YourControl = ActiveCTL then
' Do something if True
Else
' Do something if False
End If
I'll have to check this out tomorrow morning as I typing on the fly (dangerous for me), but think I'm in the BallPark...
Imoutwest
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, yes that's what i needed!