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

x
?
Solved

About SSTab

Posted on 1998-06-24
4
Medium Priority
?
224 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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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 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…

916 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