Find current tab open?

galantis

Registered User.
Local time
Tomorrow, 00:40
Joined
Feb 10, 2005
Messages
32
hi,

I have posted this up in the Forms section but received no reply so I'm going to try it here.

I am trying to work out which Tab is current been viewed/opened. My button does differrent thing depending if Tab 1 or Tab 2 etc is current been viewed.

thanks.

My idea so far (which doesn't work is): The first statement is also true.

Private Sub cmdPrintModule_Click()
Dim tbtab As Page
For Each tbtab In Tab1.Pages
If tbtab.Name = Me.Tab1.Pages("General").Name Then
Call PrintGeneral
ElseIf tbtab.Name = Me.Tab1.Pages("Piping").Name Then
Call PrintPiping
End If
Next
End Sub
Edit/Delete Message
 
The answer to all your questions is in this box...

Assumptions:
Page1 is named "General", PageIndex 0
Page2 is named "Piping", PageIndex 1

Code:
[COLOR=Blue]Private Sub[/COLOR] cmdPrintModule_Click()
   [COLOR=Blue]Select Case[/COLOR] Tab1   [COLOR=Green]' or Tab1.Value -- It defaults to .Value anyway.[/COLOR]
      [COLOR=Blue]Case[/COLOR] 0
         PrintGeneral
      [COLOR=Blue]Case 1[/COLOR]
         PrintPiping
   [COLOR=Blue]End Select[/COLOR]
[COLOR=Blue]End Sub[/COLOR]
 
thanks for that, It worked.
 

Users who are viewing this thread

Back
Top Bottom