Set Focus Between Microsoft Access Forms and Subform Controls
Question details
Move keyboard focus from a main form or another subform to a specific control inside an Access subform.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A form contains one or more subforms, and the user wants predictable keyboard navigation between their controls.
- Observed behavior
- Focus needs to move to the destination subform control before it can move to the target control inside the subform.
Open the main form in Design View and check the Name property of each subform control and target control in the Property Sheet. The subform control name may differ from the name of the form it displays.
Use VBA to focus a control in a subform
Use this approach when a button or form event should move focus to a specific control in a subform.
Call SetFocus on the subform control first, then call it on the target control inside its Form object. The destination control must be visible and enabled.
When navigating between sibling subforms, use the Parent property to reference the main form and its destination subform control.
Open the form in Design View, select the button or control that should trigger navigation, and use the Property Sheet's Event tab to create an appropriate event procedure, such as On Click.
In the main form's event procedure, replace MySub and txtGoHere with your control names and add: Me!MySub.SetFocus Me!MySub.Form!txtGoHere.SetFocus
In an event procedure on the source subform, replace OtherSub and txtGoHere with the destination control names and add: Me.Parent!OtherSub.SetFocus Me.Parent!OtherSub.Form!txtGoHere.SetFocus
Open the main form in Form View and trigger the event. Confirm that the destination subform is loaded and that focus lands on the intended control.

Configure Tab Order for keyboard navigation
Use Tab Order when users should move through controls with the Tab key rather than a VBA-triggered action.
Work with Office documents in WPS Office
WPS Office is a free, lightweight alternative for documents, spreadsheets, and presentations, with a familiar interface and Microsoft Office format compatibility that supports an easy transition. It does not run Microsoft Access forms or VBA and cannot fix Access subform focus.

Frequently Asked Questions
Why do I need to focus the subform control first?
The target control is inside the subform. From the main form, call SetFocus on the subform control first, then call SetFocus on the target through the subform control's Form property.
How do I move focus from one subform to another?
From the source subform's event procedure, use Me.Parent to reach the main form. Focus the destination subform control, then focus its target control, for example: Me.Parent!OtherSub.SetFocus followed by Me.Parent!OtherSub.Form!txtGoHere.SetFocus.
Why does SetFocus fail on my target control?
Check that the destination subform is loaded and that the target control is visible and enabled. In Design View, use the Property Sheet to verify the control names, especially the subform control's Name.
Can I control the Tab key order without VBA?
Yes. In Design View, use Tab Order on the main form and each subform to arrange their controls. Check the Tab Stop and Cycle properties, then test the sequence in Form View.




