Tab Control Set Focus?

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?
 
R

Rick Brandt

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top