Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

About SSTab

Posted on 1998-06-24
4
Medium Priority
?
217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
deighton earned 80 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

719 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