Tab out of a sub form (1 Viewer)

Stowers

Registered User.
Local time
Today, 04:27
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
 

Stowers

Registered User.
Local time
Today, 04:27
Joined
Dec 18, 2010
Messages
10
sorry to bother everyone
I have stumbled across answer
CTRL + TAB
 

John Big Booty

AWF VIP
Local time
Today, 13:27
Joined
Aug 29, 2005
Messages
8,263
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.
 

Megan

Registered User.
Local time
Yesterday, 23:27
Joined
Jun 3, 2011
Messages
23
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!
 

jmaxton1

New member
Local time
Yesterday, 22:27
Joined
Nov 20, 2020
Messages
8
I know this is old, but do you think you could share the macro language version of this? If you still have it.
 

Gasman

Enthusiastic Amateur
Local time
Today, 04:27
Joined
Sep 21, 2011
Messages
14,287
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.?
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 20:27
Joined
Oct 29, 2018
Messages
21,471
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.
 

jmaxton1

New member
Local time
Yesterday, 22:27
Joined
Nov 20, 2020
Messages
8
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.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 20:27
Joined
Oct 29, 2018
Messages
21,471
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

Top Bottom