Solved

navigating sstab in vb6

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

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 …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

770 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