SetFocus to TextBox Control on Tabbed Form

Blake

Registered User.
Local time
Today, 08:34
Joined
Aug 28, 2002
Messages
21
I've got a tabbed form with several pages. Each page has a TextBox control that I'd like to receive the focus when the user clicks that page's tab. Each page has an associated Click event, but putting Me!MyControl.SetFocus in that event doesn't work (unless I click the page body, not just the tab, which is pretty lame). Is there a simple solution?

Regards, Blake
 
Hi Blake, try this:
Code:
Private Sub myTab_Change()
    If myTab= 0 Then
        Me.myControl1.SetFocus
    Else
        Me.myControl2.SetFocus
    End If
End Sub

Dave
 
Thanks! It worked!

Regards, Blake
 

Users who are viewing this thread

Back
Top Bottom