Results 1 to 6 of 6
  1. #1
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398

    Set focus on a form with a tab control with 10 pages


    Within a form, I have a tab control that currently has 10 pages. I'd like to set the focus on a command button on the form whenever one of the pages is selected. I've tried putting the following code, "Me.cmdExit.SetFocus" on the on click event within the Tab Control and the on click event within one of the pages. It's had no effect.

    Thanks in advance!!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Is it only one page that this applies to?

    Yes, it's long been a mystery why Tab control and its pages even have Click event listed. Tab control Change event does work.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    I can't figure out anything that is consistent between the pages. When selecting a page, the focus could be anywhere on that page. I was hoping to make it consistently be on the cmd button to close the form.

    I have another question related to pages within a tab control. Using the page order option, if I move a page from bottom to the top, when I open the form, how do I get the new top page to be displayed? The previous top page is displayed.

  4. #4
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    I figured out the page order opton. I already had a line of code indicating which page to set the focus on . I think I may need to do something like that to set the focus on all of the pages.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Not sure what you mean by 'bottom to the top' - tabs are horizontal. What 'page order' option - did you mean PageIndex property?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Yes, same thing PageIndex property. I had a line of code that was setting the focus to a specific page. I had to change that code to the new PageIndex of 0. Thanks for your help!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 10-20-2014, 08:43 PM
  2. Tab Control - Tab between pages
    By manakar in forum Forms
    Replies: 3
    Last Post: 08-10-2014, 12:15 AM
  3. Tab Control Pages
    By Cleave_1b in forum Programming
    Replies: 4
    Last Post: 07-21-2014, 06:29 PM
  4. Using tab control pages
    By queenbee in forum Programming
    Replies: 1
    Last Post: 02-28-2009, 09:43 PM
  5. Tab Control Pages
    By queenbee in forum Access
    Replies: 1
    Last Post: 02-28-2009, 10:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums