×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

how to check which tab is active?

how to check which tab is active?

how to check which tab is active?

(OP)
I have a project written in Access 97 converted to Access 2010. I am hitting an error because a set focus command is trying to set focus to a field in a prior tab. How can I test which tab is active? tabOverhead.SetFocus had changed the active tab to the Overhead tab, but code tries to set focus to a tabSummary field. Can't find where this code is trigered once focus changes to Overhead tab, so was going to check that this is only performed when the tabSummary tab is active.

RE: how to check which tab is active?

You can get the active control and it's parent which I would expect to be the page in the tab control so something like:


CODE

Debug.print Me.ActiveControl.parent.name 

Even if that is not exactly right hopefully it puts you on the right track.

RE: how to check which tab is active?

If you truly want to only "set focus to a field in a prior tab" you don't have to worry about tabs. Simple code like the following should work:

CODE --> vba

Private Sub Command15_Click()
    Me.XXXX.SetFocus
End Sub 

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close