Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

navigating sstab in vb6

Posted on 2014-04-21
4
Medium Priority
?
729 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 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

972 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