Solved

navigating sstab in vb6

Posted on 2014-04-21
4
701 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 500 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 500 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

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…
Suggested Courses
Course of the Month7 days, 6 hours left to enroll

622 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