Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Unanswered: Setting focus to a control in a subform ...

    Hi all.

    It's too early yet ... I'v got a need (requirement) where I have to move to the 1st field in a continuous forms subform from the parent form (like a tab action) Any ideas???? I've been trying to use the GotoControl method without success (having to do with not getting the subform name right) ...

    THANKS!
    Back to Access ... ADO is not the way to go for speed ...

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Like I said ... Too early.

    Solution:

    Me![ClockCardDetail].SetFocus
    Me![ClockCardDetail]!WO_ComboBox.SetFocus

    Set focus to the subform control and then to the control on the subform ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Try also, Forms("yourFormName").yourSubFormName!text_BoxName .SetFocus

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Try also, Forms("yourFormName").yourSubFormName!text_BoxName .SetFocus

  5. #5
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Try also, Forms("yourFormName").yourSubFormName!text_BoxName .SetFocus

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by hammbakka
    Try also, Forms("yourFormName").yourSubFormName!text_BoxName .SetFocus
    Hammy,

    BUT, the MS docs say to set the focus to the subform control THEN set the focus to the control within the subform ... Hence my solution. )Although they might be overly cautious ...)

    - Mike
    Back to Access ... ADO is not the way to go for speed ...

  7. #7
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    789
    Provided Answers: 1
    Hi

    Looking at the previous suggestions I think ths is what is required

    To refere to a control on a subform the syntax (I believe) is

    me.[NameofMainformsubformControl].Form.[subformControlName].setfocus

    or if the subform is contained in another open form then

    Forms![OtherMainformName].[NameofMainformsubformControl].Form.[ControlNameon SubForm].setfocus

    In short you have to refer to thr FORM contained in the subform control of ther main form (because the controls are contained in the subform FORM, not the subformcontrol of the main form).

    Hope that makes sense!


    MTB

Posting Permissions

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