?
Solved

show the correct tab

Posted on 2002-04-23
7
Medium Priority
?
188 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 143

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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 143

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 400 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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month3 days, 19 hours left to enroll

599 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