Solved

show the correct tab

Posted on 2002-04-23
7
179 Views
Last Modified: 2010-05-02
Ho I have 3 tabs. Data is entered in text boxes on each tab then the save button is clicked. the save button is on the form not on any of the tabs. The text boxes are validated. If there is invalid data then focus is set to this textbox and the text highlighted. Now my question is how do I show the correct tab with the invalid text box. ie I am looking at tab3, but the invalid textbox is on tab1. How do I switch to tab1. Is there a way of knowing which tab contains the textbox so that I can include this code in my validation procedure.

I am using VB6 and SSTab
thanks
Merlin007
0
Comment
Question by:merlin007
7 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6962498
What is you tab control?
Try checking the .Parent and the .Owner properties of the text box, one of them is the form, the other one points to the control the textbox is on.

CHeers
0
 
LVL 2

Expert Comment

by:corvanderlinden
ID: 6962524
One solution is to save the tabnumber your control is on, in the control's Tag

Then use SSTab.Tab=ctl.Tag
0
 

Author Comment

by:merlin007
ID: 6962534
angellll
I tried the .Parent property but this gave me the form. There is no owner property for textbox.

corvanderlinden
Thanks I will try this. At the moment I am using the tag a lot so I will have to parse the string again.

Thanks all

merlin007
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6962558
Sorry, i wanted to write Container and not owner...

CHeers
0
 
LVL 1

Expert Comment

by:kavithag
ID: 6962574
Your Control right now is on tab(2).

To set the Focus at the text box of Tab(0).Setfocus will set the Focus to 1st tab and then giving text1.setfocus will set it to the required text.
0
 
LVL 3

Accepted Solution

by:
n_narayanan earned 100 total points
ID: 6962605
Follow the steps

1. Place separate frames in all the tabs and place the controls inside the frames.
2. Name the frame as yourframename_0 for first tab's frame
3. like that yourframename_1 for 2nd tab and so on.
4. Suppose you have problem in text2 of 1st tab, but you are not in 1st tab (may be 2nd or 3rd tab).
5. tabcontrolname.tab = right(text2.container.name,1)
6. text2.setfocus

Step 5 and 6 does the actual job.

Cheers

Narayanan

0
 

Author Comment

by:merlin007
ID: 6962652
Thanks everyone
n narayanan has just what I wanted. It saves adding more to the tag property and I had the frames.

Thanks again

Merlin007
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

708 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

12 Experts available now in Live!

Get 1:1 Help Now