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

    Cannot Set Focus on Subform Control (2003)

    If, on the startup form of the attached mdb, I enter, say, 12 in the OREDE text box and then press the Enter key, the focus goes to the OREFU text box on the Gruppo4 subform because it's the first control in that subform's tab order.
    Since I've set the OREFU text box on the Gruppo5 subform as the first control in that subform's tab order, I was expecting that, when I click on the "Gruppo 5" tab, the OREFU text box on the Gruppo5 subform should get the focus but it doesn't. I've tried using
    <font color=448800>Me.gruppo5.SetFocus
    Me.gruppo5.Form.OREFU.SetFocus</font color=448800>
    for the click event of the Gruppo 5 page to no avail.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cannot Set Focus on Subform Control (2003)

    The event to use is the On Change event of the tab control as a whole. This event already has code:

    Private Sub TabCtl0_Change()
    Me!CGior.SetFocus
    End Sub

    so each time you click on a tab, you set focus to CGior on the main form. Removing Me!CGior.SetFocus should help.

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

    Re: Cannot Set Focus on Subform Control (2003)

    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>Hans <img src=/S/blush.gif border=0 alt=blush width=15 height=15>

Posting Permissions

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