Tabcontrol form question (1 Viewer)

Jon123

Registered User.
Local time
Yesterday, 20:03
Joined
Aug 29, 2003
Messages
668
Can I open a tabed form to a specific page?
If I'm in the form I can move focus by using
Me.[Page 12].SetFocus
but when opening using that code produces and error Page not available?

jon
 

Beansy

Registered User.
Local time
Today, 12:03
Joined
Dec 19, 2012
Messages
20
So you have a form that contains a Tab Control?

If so, use the following code in the On Load event to open to tab 14

Me.tabControl = 14

note: replace tabControl with the name of your tab control
 

MarkK

bit cruncher
Local time
Yesterday, 17:03
Joined
Mar 17, 2004
Messages
8,187
A tab page has a caption and a name. If you want to address the page directly in code you need to use its name, not its caption.

This works on my machine . . .
Code:
    Me.Page8.SetFocus
. . . where the page is named "Page8".
 

Keith Tedbury

Registered User.
Local time
Today, 01:03
Joined
Mar 18, 2013
Messages
26
If you are opening the form from a button on another form you can set the focus there, after the line that opens the form.

DoCmd.OpenForm "FORM_NAME", , , stLinkCriteria

forms!FORM_NAME!Tab.setfocus

Advantage of doing it there is that you can open the form from different places and have a different focus for each one.
 

Users who are viewing this thread

Top Bottom