Solved

About SSTab

Posted on 1998-06-24
4
173 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

763 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

11 Experts available now in Live!

Get 1:1 Help Now