Solved

How to move to the next tab by clicking a button?

Posted on 2003-12-04
2
197 Views
Last Modified: 2010-05-01
Hello Experts,
I need to know how you can move from one tab in the "ssTab dialog control" to the next tab by click a button. To make myself clear, I have a tabbed dialog control and a button on it. If I click the button it should move to the next tab which contains the next procedure in my form. Hope I'm clear enough to get the feedback from you guys. Any help is appreciated in advance
0
Comment
Question by:schesht
2 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 50 total points
ID: 9880459
Private Sub Command1_Click()
    If SSTab1.Tab = SSTab1.Tabs - 1 Then
        SSTab1.Tab = 0
    Else
        SSTab1.Tab = SSTab1.Tab + 1
    End If
End Sub
0
 
LVL 3

Expert Comment

by:ashoooo
ID: 9882933
This is what I use on Click events for Next and Back buttons


Private selectedTab As Integer
...

Private Sub cmdNext_Click()
    tsMain.Tabs(selectedTab + 1).Selected = True
    SetPictBoxOnTabChange
End Sub

Private Sub cmdBack_Click()
    tsMain.Tabs(selectedTab - 1).Selected = True
    SetPictBoxOnTabChange
End Sub




Private Sub SetPictBoxOnTabChange()
    Dim i As Integer
    On Error Resume Next
   
    For i = 1 To tsMain.Tabs.Count
        If tsMain.Tabs(i).Selected Then
            selectedTab = i
        End If
    Next i
   
    If selectedTab = 1 Then
        cmdBack.Enabled = False
    Else
        cmdBack.Enabled = True
    End If

    If selectedTab = tsMain.Tabs.Count Then
        cmdNext.Enabled = False
    Else
        cmdNext.Enabled = True
    End If
End Sub

0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel VBA combine two working workbooks 8 54
Convert VB6 MSXML2.ServerXMLHTTP process to C# 2 47
Help me. 3 55
which modules are active in VB6 project? 6 12
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

777 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