Tab PageIndex

J

john

Is it possible to reference the PageIndex instead of the Page name as in the
following


instead of Me.frmAssociates.Left = Me.Associates.Left
Somthing like Me.frmAssociates.Left =
..Pages(.Value).PageIndex.Left

This is a sample what I use now on the tab On change event:

Dim ThisTab As Integer
With Me.TabCtl0
ThisTab = .Pages(.Value).PageIndex
End With
Select Case ThisTab

Case 0


If Me.Associates.Tag = "" Then
Me.frmAssociates.Left = Me.Associates.Left
Me.frmAssociates.Top = Me.Associates.Top
Me.frmAssociates.Width = Me.Associates.Width
Me.frmAssociates.Height = Me.Associates.Height
Me.Associates.Tag = "1"

End If

End Select
 
S

Surendran

Yes.You can reference page index in the change event.
With Me.TabCtl0
ThisTab = .Pages(.Value).PageIndex
'ThisTab = .Value
End With
The commented line is also assigning tab index to the variable. i.e
tabcontrol.value is page index.

Surendran
 
J

john

Thank you,

The area that I was trying to effect was the sizing & I was not clear on
that, my goal was to reference the pageindex number in the sizing code
instead of the name. Which I finaly figured out with the following:

Me.frmAssociates.Left = Me.TabCtl0.Pages(ThisTab).Left

Which means I do not have to rename the code for each tab name to get its
current position.
Now about the left side of the = sign, can I refer to it by it being the
form, on the current tab without using its name:

Instead of : Me.frmAssociates.Left = Me.TabCtl0.Pages(ThisTab).Left

Somthing Like: Me.[SubForm On].[Me.TabCtl0.Pages(ThisTab)].Left =
Me.TabCtl0.Pages(ThisTab).Left

If this is somehow possible then I would only need one set of sizing code
for all the Tabs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top