Code to Tab Between form and subforms

  • Thread starter Thread starter bisselie
  • Start date Start date
B

bisselie

Guest
I have a form which contains 2 subforms. The main form will tab into the first subform but then just stays in the first subform. I want to be able to tab from the last field of the first subform into the first field of the second subform, then from the last field of the second subform to the first one of the main form.

I have been advised to use onExitEvent to set focus to control I want. Unfortunately I
am getting mixed up with code syntax.

Would appreaciate some help with syntax.

For info subform1 name RPD last field name ALT2_NGR
Subform2 name QLV first field name Option.
 
When you use a subform the syntax to identify it is
Forms![mainform]![subformName].form
In your case:
Forms![MainForm]![RPD].form![ALT2_NGR]
Be sure that the subform is really called "RPD" in your main form
Hope this helps you, S.
 
In the last control of the first subform using the onExitEvent type
me.parent![QLV].setfocus
in the last control of the second subform using the onExitEvent type
me.parent![X].setfocus
where X is the name of the first control on your main form.
 
You could create a macro and use the sendkeys command.

Put this: ^{tab} in the keystrokes field on your macro. I have a form that has 8 subforms. Add the macro to the "On Lost Focus" of the last field inside of your subform. Hope this helps.
 

Users who are viewing this thread

Back
Top Bottom