Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    If has focus, then...

    I want to search, that's all, and I can do it with one field, however, I cant to capture the field which last had the focus, and set my search range accordingly.. any ideas? (All this is being done from a userform...)
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: If has focus, then...

    Don't know for sure what you really want, but you can read the tabindex of each control on a userform.
    The code below can be in a subroutine in a module or in the commandbutton_click event, depending on what you really want. The code just loops through all controls on the userform (which is here called UserForm1) and displays the typename and tabindex of the control on the form.

    Dim obj As Object
    Dim q As Integer
    For Each obj In UserForm1.Controls
    q = obj.TabIndex
    MsgBox "TabIndex(" & TypeName(obj) & ") = " & Str$(q)
    Next

    Hope this helps.

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: If has focus, then...

    Ahhh tab index... Thanks Hans!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •