Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

navigating sstab in vb6

Posted on 2014-04-21
4
Medium Priority
?
713 Views
Last Modified: 2014-04-21
I have an sstab form (sstMain) and it has 4 tabs.  The tab that opens when the form opens is index = 0.  I want some things to happen when I open another tab.  How can I do that?  I am having no luck...
0
Comment
Question by:Bob Schneider
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 16

Assisted Solution

by:HooKooDooKu
HooKooDooKu earned 2000 total points
ID: 40013228
Does the Tab Click Event not work?

Private Sub sstMain_Click(PreviousTab As Integer)
  MsgBox "The Index of the previous Tab was " & PreviousTab
  MsgBox "The Index of the current Tab is " & sstMain.Tab
End Sub

Open in new window

0
 

Author Comment

by:Bob Schneider
ID: 40013266
YEah that works...so how do I write code there based on which index is selected.  If it is 0 I want to execute some code...if it is 1 some other code.  Or should I write all of the code in the form load and just let it display based on what tab is opened?
0
 
LVL 16

Accepted Solution

by:
HooKooDooKu earned 2000 total points
ID: 40013300
Use a big select statement or If statements:
Private Sub sstMain_Click(PreviousTab As Integer)
  Select Case sstMain.Tab
    Case 0: Call Tab0()
    Case 1: Call Tab1()
    Case 2: Call Tab2()
    ...
  End Select
End Sub
Private Sub Tab0()
  'Things to do for Tab 0
End Sub
Private Sub Tab1()
  'Things to do for Tab1
End Sub
...

Open in new window

Private Sub sstMain_Click(PreviousTab As Integer)
  If sstMain.Tab = 0 Then
    'Things to do for Tab 0
  ElseIf sstMain.Tab = 1 Then
    'Things to do for Tab 1
  ...
  End If
End Sub

Open in new window

0
 

Author Closing Comment

by:Bob Schneider
ID: 40013312
Thank you very much!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Suggested Courses

715 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