Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Any way to place Tab Page Controls in Form Header? 1

Status
Not open for further replies.

number2

Technical User
Oct 25, 2001
284
US
I would like to enable Tab Page changes from the header. This enables the user to always have Tab Page changes without scrolling to the top of the screen. Can it be done?
 
My 2 cents' worth is on your thread702-188582
Gus Brunston :cool: An old PICKer, using Access2000
padregus@attbi.com

 
Yes a menu would work well, but would prefer using command buttons because they will look just like the tabs and will do the job with just a single click. Set the click event for each cmdButton to:

Me.TabCtl.Pages(requiredpagename).SetFocus

Tunsa Rod
 
Thanks for the help. So I CAN place a button in the form header which will move the user to the desired Tab Page? Can you give me an example using your above code. I tried it but failed.
 
Using:
Me.TabCtl89.Pages(Page90).SetFocus
I get the error, "objecy doesn't support this property or method"
 
You are right that does produce an error because the argument requires the relative page position in the Tab control's Pages collection.

Assuming that you have a three page tab control called MyTabCtl with pages named Page01, Page02 and Page03. These will have a Tab Collection reference of 0, 1 and 2. This is because Collections always number from zero.

So for the above example set up three buttons and use the following code.

Private Sub cmdbtn1_Click()
Me.MyTabCtl.Pages(0).SetFocus
End Sub

Private Sub cmdbtn2_Click()
Me.MyTabCtl.Pages(1).SetFocus
End Sub

Private Sub cmdbtn3_Click()
Me.MyTabCtl.Pages(2).SetFocus
End Sub


I have tested it and it does work. Really.

Rod

 
Works like a charm! Thanks so much. Good by Tab Control!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top