Solved

navigating sstab in vb6

Posted on 2014-04-21
4
655 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
  • 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

760 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

22 Experts available now in Live!

Get 1:1 Help Now