I'd been searching for a way to do this when the subform contains many records and this ended up working for me. I created a macro (here it is converted by Access to code):
'------------------------------------------------------------
' mcrTabOutOfSubQLI
'
'------------------------------------------------------------
Function mcrTabOutOfSubQLI()
On Error GoTo mcrTabOutOfSubQLI_Err
With CodeContextObject
If (IsNull(.txtControlToTabOutOf)) Then
DoCmd.GoToControl "[txtControlToTabTo]"
End If
End With
mcrTabOutOfSubQLI_Exit:
Exit Function
mcrTabOutOfSubQLI_Err:
MsgBox Error$
Resume mcrTabOutOfSubQLI_Exit
End Function
I doubt this is very elegant, but it got the job done. Thank you for the helpful posts!