Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to tab out of a subform???

Status
Not open for further replies.

BCarruth

Programmer
Feb 8, 2001
19
US
Is there any way to code a way out of a subform rather than use the control/tab keys (or is it alt/tab keys?)?
Thanks
Bob
 
Use an appropriate event to set the focus back to a control on the parent form.

I use the Exit event of a control on the subform. If the control is empty/null, move back to the main form, otherwise do something else on the subform.

Code:
'If the MyField field is empty, exit the subform and
'return the focus to the MyForm form.
    If IsNull([MyField]) Then
        Parent![Tenant].SetFocus
    Else
        ...do something else
    End If

Hope this helps.
Lightning
 
Thank you very much!!
The code worked perfectly.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top