Tab Control Set Focus?

  • Thread starter Thread starter scott
  • Start date Start date
S

scott

I have a tab control and a subform on the 3rd tab. Is there a way to detect
if a user clicks a certain tab?

My problem is when a user clicks the 3rd tab, I need the subform to set
focus to a new record. I've tried putting an invisible rectangle over the
tab, but nothing seems to allow an event to fire if a certain tab is
clicked?

Any workarounds?
 
scott said:
I have a tab control and a subform on the 3rd tab. Is there a way to detect if
a user clicks a certain tab?

My problem is when a user clicks the 3rd tab, I need the subform to set focus
to a new record. I've tried putting an invisible rectangle over the tab, but
nothing seems to allow an event to fire if a certain tab is clicked?

Any workarounds?

Use the Change event of the entire TabControl and test its value property to
determine which TabPage was selected.

If Me.TabControlName.Value = 2 Then
'the third page was selected
End If
 
Back
Top