Solved

About SSTab

Posted on 1998-06-24
4
201 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 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

751 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