Tab out of a sub form

Stowers

Registered User.
Local time
Today, 00:18
Joined
Dec 18, 2010
Messages
10
when I have gone into a subform to enter data how can I then tab out back to the next control on my main form

many thanks

ian
 
sorry to bother everyone
I have stumbled across answer
CTRL + TAB
 
You can also put some code in the On Lost Focus event of the last tab stop of your Sub-form that Set's the focus to the next logical tab stop on your main form, something along the lines of;
Code:
Me.Parent!ControlName.SetFocus
You could also include in that some code to ensure that the Sub-form was correctly populated by the user.
 
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!
 
I know this is old, but do you think you could share the macro language version of this? If you still have it.
 
I know this is old, but do you think you could share the macro language version of this? If you still have it.
Being so old, you might not get a reply from those posters?

You could try the SendKeys option with the Ctrl+Tab mentioned, if you insist on using a macro.?
 
I know this is old, but do you think you could share the macro language version of this? If you still have it.
Hi @jmaxton1. This is a 10-year old thread and @Megan was last seen in 2012, so you may not get an answer any time soon.
 
Agreed. My replying to this post was dumb of me. I was able to get it working decently with a submacro that checks for {TAB} and moves it to the next control in line.
 
Agreed. My replying to this post was dumb of me. I was able to get it working decently with a submacro that checks for {TAB} and moves it to the next control in line.
Hi. Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom