Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2010
    Posts
    186

    Unanswered: Setfocus - tab control/subform/control

    I have a main form with a tab control that has 2 pages, each of those pages has a subform.
    When tabbing through the data entry on the main form, Access will automatically go from the last control of the main form to the first tab, then it seems to hold there. The main form requeries, the subform becomes active - but you have to press tab again to get into the first control of the subform.

    I thought perhaps I could write an on-exit in the last control of the main form to speed this up.....

    would i set focus to the page, then the form, then the control, like:
    Me.page1.Setfocus
    Forms!mainform!subform.setfocus
    docmd.gotocontrol controlname

    thanks!

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    The correct syntax would be:

    Me.NameOfSubFormControl.SetFocus

    Me.NameOfSubFormControl.Form!NameOfControl.
    SetFocus

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Jun 2010
    Posts
    186
    thank you Linq - worked perfect!

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Glad we could help!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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