Solved

Using Tab

Posted on 2009-03-31
4
207 Views
Last Modified: 2012-05-06
I'm using sstab which composed 8 tabs.  i used command button to move and back the desired tab. How to move and back the tab by using command button?
Private Sub Next_Click()

eTab.Tab = 0 + 1 ' how to move to tab 2,3,4,5,6,7, and 8

End Sub
 

Private Sub Back_Click()

eTab.Tab 'how to back the previous tab from the current tab

End Sub

Open in new window

0
Comment
Question by:Whing Dela Cruz
  • 2
4 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 24030244
something like this:
Private Sub Back_Click()

    If eTab.TabIndex > 0 Then

        eTab.TabIndex = eTab.TabIndex - 1

        eTab.TabVisible(eTab.TabIndex) = True

        eTab.Tab = eTab.TabIndex

    End If

End Sub
 

Private Sub Next_Click()

    If eTab.TabIndex < eTab.Tabs - 1 Then

        eTab.TabIndex = eTab.TabIndex + 1

        eTab.TabVisible(eTab.TabIndex) = True

        eTab.Tab = eTab.TabIndex

    End If

End Sub

Open in new window

0
 
LVL 16

Accepted Solution

by:
robinu earned 250 total points
ID: 24030279
How about this? :
Private Sub Next_Click()

    Dim iTab As Integer

    

    iTab = eTab.Tab

    iTab = iTab + 1

    If iTab > 7 Then

        iTab = 0

    End If

    eTab.Tab = iTab

End Sub

 

Private Sub Back_Click()

    Dim iTab As Integer

    

    iTab = eTab.Tab

    iTab = iTab - 1

    If iTab < 0 Then

        iTab = 7

    End If

    eTab.Tab = iTab

End Sub

Open in new window

0
 
LVL 49

Assisted Solution

by:Ryan Chong
Ryan Chong earned 250 total points
ID: 24030404
sorry, try this instead:

Private Sub Back_Click()
    If eTab.Tab > 0 Then
        eTab.Tab = eTab.Tab - 1
    End If
End Sub

Private Sub Next_Click()
    If eTab.Tab < eTab.Tabs - 1 Then
        eTab.Tab = eTab.Tab + 1
    End If
End Sub
0
 

Author Closing Comment

by:Whing Dela Cruz
ID: 31564888
Thanks to you guys!
All Code is working..
thanks! And more power to you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now