Results 1 to 4 of 4
  1. #1
    TToc2u is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2011
    Posts
    9

    Thumbs up Tab index multiple subforms

    I have a parent form with two subforms, one of which contains additional subform.

    I would like the user to be able to tab through the whole form. My idea is to set a button as the last tab index on a subform that will set focus (when it recieves focus) to the target subform. Then i will make the button invisable.

    Form organization



    • Parent Form
      • Subform1 <--- buton location
      • subform2
        • sub-subform <--- button target


    I want to set the focus from subform 1 to sub-subform using button

    this is the coding I have in the buttons (on focus) event:


    =[Forms]![Parent Form]![Subform2].[Form]![sub-subform].[Form]![sub-subform control].SetFocus

    No error... just doesnt do anything.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Moving the focus to SubForms is not real straight forward. It is a two step process. First you need to set the focus to the SubFormControl and then in the next step the control you want on the actual SubForm.

  3. #3
    TToc2u is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2011
    Posts
    9
    What do you mean by a subform control. i know what a textbox control is but I dont see the sam "control source" option under the form tab.

    Do you think you can give me some example coding?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    A Form is displayed on another Form by means of a SubFormControl. It defaults to being named the same as the SubForm it displays, but it need not be so. This SubFormControl has two special properties on the Data tab of the property sheet: LinkMasterFields and LinkChildFields. Your command button should have an [Event Procedure] in the click event so it will use code. The code will look like:

    Forms.MainFormName.SubFormControl2.SetFocus
    Forms.MainFormName.SubFormControl2.Form.sub-subformControl.Form.ControlOnsub-subform.SetFocus
    ...using your names of course.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Multiple subforms to one main form
    By mick3911 in forum Forms
    Replies: 8
    Last Post: 02-25-2013, 09:40 PM
  2. Can you place Multiple Field Names to a Single Index?
    By VanillaAwesome in forum Access
    Replies: 2
    Last Post: 08-05-2012, 04:40 PM
  3. Replies: 2
    Last Post: 06-20-2012, 12:00 PM
  4. Form with multiple subforms, many prompts
    By funkstrong in forum Forms
    Replies: 2
    Last Post: 10-12-2011, 11:40 AM
  5. position multiple subforms
    By Mclaren in forum Programming
    Replies: 1
    Last Post: 07-12-2010, 08:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums