Solved

About SSTab

Posted on 1998-06-24
4
186 Views
Last Modified: 2010-05-03
hi, I have a SSTab control on a form, I tryied to code to open the form with the appropriate  tab that I want. For example, I have a line somewhere like : load form1.
form1 has 1 SSTab control  with tab1, tab2. Usually, tab1 will be automatically showed up when the form loads. Now I want to code after load form1 to open the form1 with tab2 showed up. How do I do that?

Thank you very much and have a nice day!

:)
chris
0
Comment
Question by:ny971181
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
deighton earned 20 total points
ID: 1464167
Private Sub Form_Load()
    SSTab1.Tab = 1
End Sub

NB the tabs are numbered 0,1,2, ....

i.e tab1 = 0 ,tab2 = 1

0
 
LVL 1

Author Comment

by:ny971181
ID: 1464168
deighton:
what happen in this case? I forgot this point.

in form1
Private Sub form_load(0
     sstab.tab = 0
end sub

in form2
Private Sub cmd1_click()
     load form1
end sub

Now when I click cmd1, it will load form1, but with tab 0. where should I code to open the form with tab1 without changing the line sstab.tab = 0?

sstab.tab = 0 in form_load can't be changed because in most cases, the form will be opened with tab 0. And in some other cases, It need to be opened with tab 1. That is my real question..

I am sorry for that.

thank you again

:)
ny971181
0
 
LVL 18

Expert Comment

by:deighton
ID: 1464169
I would use a global Boolean variable as below

'in Form2 declarations
Public bTab1 As Boolean

'In form2

Private Sub Command1_Click()
    bTab1 = True
    Form1.Show
End Sub

'In form 1
Private Sub Form_Load()

    If Form2.bTab1 = True Then
        SSTab1.Tab = 1
    Else
        SSTab1.Tab = 0
    End If
    Form2.bTab1 = False
   
End Sub

0
 

Expert Comment

by:qhenry
ID: 1464170
You'll find that the SSTab opens by default where you last left it at design time. By setting the {tab=} in code, you can force it to be consistent in each context you open the form.

Hope this helps.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

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…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…

786 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