Open a Form at a particular Tab Control Page (1 Viewer)

ted.martin

Registered User.
Local time
Today, 17:27
Joined
Sep 24, 2004
Messages
743
Does anyone know of the way to Open a Form so that it opens at (say) page 3 of the tab control.

I thought about a flag variable on the forms Load event but the SetFocus code does not help as the form still opens with Page 1.

If strFlag = "Page3" Then
Me.Page3.SetFocus
End If

Thank you.
 

boblarson

Smeghead
Local time
Today, 10:27
Joined
Jan 12, 2001
Messages
32,059
In the form load event you can put:
Code:
Me.YourTabControlName.Pages(n).SetFocus
where n is the page number (zero based) and YourTabControlName is the name of the tab control, not the page name.

You can also use the page name, if you prefer, by using:
Code:
Me.YourTabControlName.Pages("YourPageNameHere").SetFocus
 

ted.martin

Registered User.
Local time
Today, 17:27
Joined
Sep 24, 2004
Messages
743
Thanks Bob. Much appreciated.
 

Users who are viewing this thread

Top Bottom