Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting focus to textboxes when using a tabstrip

Status
Not open for further replies.

Catrina

Programmer
Feb 11, 2000
70
US
I have a tabstrip with 4 tabs. I am using 4 frames to hold the text boxes for use with each tab. Each text box has a corresponding label containing a field code for the box.

What I need to do is be able to search for the field code and setfocus to that corresponding textbox. I can do this, but it only finds the labels that are showing on the first tab(frame). I need it to look through all the tabs(frames) and setfocus if the needed box is on a tab not showing at the time. Here is the code I have the works, but only on the visible textboxes.



private Sub txtSearch_KeyPress(KeyAscii as Integer)
If KeyAscii = 13 then
KeyAscii = 0
ZOUT$ = txtSearch.Text
Cnt% = lblField.Count - 1
For A% = 1 to Cnt%
If ZOUT$ = lblField(A%).Caption then
Text(A%).SetFocus
fraSearch.Visible = false
Exit Sub
End If
Next A%

MsgBox "Field Code Not In File"
txtSearch.Text = ""
End If
End Sub


Any suggestions?

Catrina
[sig][/sig]
 
Catrina,

It might get ugly, but you could add an outter loop which sets the tab to each value in turn

For xxx = 1 to NTabs
[tab]sstab1.tab = xxx

[tab]your thinggy here
'Note in your code, set a flag to say you found the object

if (objectFound) Then
[tab]Exit For
End If
next xxx [sig]<p>MichaelRed<br><a href=mailto:mred@duvallgroup.com>mred@duvallgroup.com</a><br>There is never time to do it right but there is always time to do it over[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top