Results 1 to 7 of 7
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Focus Setting on Tab Control Content (2003)

    If you look at the tab order for the startup form of the attached mdb, you can see that the TabCtl0 tab control gets the focus upon leaving the txtQt text box. Is there any way to have the LETTUR text box on the subforms get the focus in turn once the TabCtl0 tab control gets the focus? I've tried using the SetFocus method in the Activate event for the subforms to no avail.

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Focus Setting on Tab Control Content (2003)

    Giorgio,

    In the On Exit event of txtQt, use the following code :

    Private Sub txtQt_Exit(Cancel As Integer)
    Me.Mpne1.SetFocus
    Me.Mpne1.Form.LETTUR.SetFocus
    End Sub
    Francois

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Focus Setting on Tab Control Content (2003)

    Thank you Francois <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Focus Setting on Tab Control Content (2003)

    I would use a similar, but slightly different approach. I'd create a transparent command button, and place it immediately after txtQt in the tab list. In its GetFocus event, I'd put the code to jump to LETTUR. This way, this code will only fire if the user tabs out of txtQt.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Focus Setting on Tab Control Content (2003)

    I usually use a locked, zero height, zero width unbound textbox for the same purpose.
    Charlotte

  6. #6
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Focus Setting on Tab Control Content (2003)

    Thank you Mark and Charlotte, I hadn't noticed clicking outside of the txtQt text box invariably positions the cursor in the LETTUR text box if you use the text box Exit event.

  7. #7
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Focus Setting on Tab Control Content (2003)

    The only reason I prefer the tranparent command button is because I can easily see it on the screen in design mode! <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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