We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Execute code, only on a textbox

hrolsons
hrolsons asked
on
Medium Priority
241 Views
Last Modified: 2012-05-11
I have the following code that is working fine:

Private Sub WebBrowser1_LostFocus()
    On Error Resume Next
    Dim ac As Control
    Set ac = Me.ActiveControl
    If Not ac = False Then
        Me.SetFocus
        If Not ac Is Nothing Then
            If ac.Enabled And ac.Visible Then
                ac.SetFocus
            End If
        End If
    End If
    On Error GoTo 0
End Sub

I'd like the code to fire only if the ActiveControl is a textbox.  Any ideas?
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2015
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.