By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,793 Members | 1,257 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,793 IT Pros & Developers. It's quick & easy.

Navigating a Tab Control

P: n/a

I have a tab control with 3 pages. I am on page 2 of the Tab
Control, and I am trying to set the focus to the 1st combo box on
that page.

I have this so far:


but, instead it sets the focus to cboMOI1 which is on page 1 of the
Tab Control.

I also tried


but that didn't work either.

Any ideas on how to solve this issue?

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
these both worked... between the two, you should be able to sort it

Private Sub Command19_Click()
'--just returns some inane thing like
' cboName=Dog
'--in a message box

Dim strMsg As String
strMsg = Me.TabCtl0.Pages(2).Controls(0).Name & "=" &
MsgBox strMsg
End Sub

Private Sub Command20_Click()
End Sub

so you should be able to use
Me.TabCtl0.Pages(2).Controls("ControlName").SetFoc us

just as well. Just modify to suit your needs.

One other fun thing - the tab controls don't act like real containers
(like a subform does), so you can't have two controls on the same tab
control but on different pages... (Was wondering why I couldn't
specify a tab number of anything when I was in the QBE!)

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.