I have a form with a mainform and a subform. When the user is in the textbox, which is the closest to the subform, and the user press Tab, it has to jump into the subform, but it doesn't. It jumps to the textbox AFTER the subform. When the user is in the last textbox of the mainform and te user press tab, then it jumps into the subform.
How do I make sure, that the user will jump to the subform when he is in the textbox, which is the closest one to the subform?
Example image:
Tab order in the UI does not account for controls on subforms, but this can be done programmatically. Set a LO Basic macro on the
When losing focus
Event
for the control that is closest to the grid/table control on the subform. That is the control that, when you tab past it, you want to go to the grid. For that event, run a macro like this, wheregrid1
is the table/grid control:You also will need to set up a similar macro when leaving
grid1
as, because it is in the subform, it is not accounted for in the tab order.Hat tip to probe1@ooForum.