Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Florida, USA
    Posts
    394
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Tab Order on tab control form (Office 2000)

    Hello,
    Is there any way to have the tab order go from tab to tab on a tab controlled form? Seems as if it treats every tab as an individual. Am I missing something?

    Thanks!
    Louise

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Tab Order on tab control form (Office 2000)

    Once the tab control has the focus, you can use Ctrl+Tab to activate the next tab, and Shift+Ctrl+Tab to activate the previous tab

  3. #3
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Florida, USA
    Posts
    394
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Order on tab control form (Office 2000)

    Hi Hans,

    I was thinking more of data entry. When I finish entering data on one tabbed sheet and hit enter, it would automatically go on to the first entry of the next tab. (Like reading a book). If it can't be done, that's ok, I just thought I'd ask.

    Thanks!
    Louise

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Tab Order on tab control form (Office 2000)

    You could use code in the On Exit event of the "last" control in a tab sheet:

    Private Sub txtLast_Exit(Cancel As Integer)
    Me.ctlTab.Value = Me.ctlTab.Value + 1
    End Sub

    where txtLast is the last control on the tab sheet, and ctlTab is the name of the tab control. But it'll only work if the user tabs his/her way through the controls, which in a Windows application is not necessarily always true.

    Again, Ctrl+Tab can be used to activate the next tab page from any control, not just the "last" one.

  5. #5
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Tab Order on tab control form (Office 2000)

    I would put a transparent command putton as the last tab stop on each tab. Use it's GotFocus event to move to another tab. The advantage of this method is that it only fires when user tabs out of last visible control, not when they exit that control any other way (such as using the mouse).
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  6. #6
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Florida, USA
    Posts
    394
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Order on tab control form (Office 2000)

    Thank you! Sounds great!
    Louise

  7. #7
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Florida, USA
    Posts
    394
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Order on tab control form (Office 2000)

    Hi Mark,
    How would I go about adding a command button to move to another tab? I know how to make it transparent thru the "format", but when I click on the toolbox for the command button, I choose "form operations" on the wizard right? It then wants to know which form to open.

    I've seen the "gotFocus" on various properties windows and assume that would be where I would enter the "event"?

    I would appreciate a little more guidance? Thanks again.
    Louise

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Tab Order on tab control form (Office 2000)

    The Command Button Wizard only creates an On Click event procedure, so you cannot use it to create an On Got Focus event procedure. You will have to create the code yourself:

    - Select the command button (in design view).
    - Activate the Event tab of the Properties window.
    - Click in the On Got Focus event.
    - Select [Event Procedure] from the dropdown list.
    - Click the ... button to the right of the dropdown list.
    - Make the code look like this:

    Private Sub cmdTransparent_GotFocus()
    Me.ctlTab.Value = Me.ctlTab.Value + 1
    End Sub

    - In the above code, cmdTransparent is the name of the command button, and ctlTab is the name of the tab control.

  9. #9
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Florida, USA
    Posts
    394
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Order on tab control form (Office 2000)

    Hi Hans, Thank you.

    I tried what you instructed but must have done something wrong. I received an error as follows:

    "The expression On Got Focus you entered as the event property setting produced the following error: Ambiguous name detected: cmdTransparent_GotFocus."

    I named the control Transparent ( I think). That's what it says in the "name" section of the properties window. The tab that I want to go to is named "Payroll Information".

    What was produced was this:

    Private Sub Transparent_GotFocus()
    Me.Payroll_Information.Value = Me.Payroll_Information.Value + 1

    End Sub

    There's no "cmd" before Transparent. If I enter one, seems like the event disappears. Is there supposed to be a "_" between Payroll and Information?

    Now, when you said "Select the command button". I assumed that one was already created? which is what I did by starting one and then hitting cancel?

    Sorry if I sound so confused, but I guess I am! LOL

    Thanks.
    Louise

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Tab Order on tab control form (Office 2000)

    In the first place, if you get an error message "Ambiguous name detected: cmdTransparent_GotFocus", you probably created two (or more) procedures named cmdTransparent_GotFocus. Search for them, and delete them all.

    If your command button is named Transparent, the procedure should start as posted by you:

    Private Sub Transparent_GotFocus()

    If your tab page is named Payroll Information, VBA will transform it into Payroll_Information, since VBA can't handle names with spaces in them. However, you shouldn't use the name of the tab page, but that of the tab control as a whole. You can see its name by clicking in the narrow strip to the right of the tabs and looking at the Properties window.

  11. #11
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Florida, USA
    Posts
    394
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Order on tab control form (Office 2000)

    Hi Hans,
    You're right! For some reason, I had more than one. I deleted them all, decided to call the control button "NextTab" and tried again. The main tab control's name is TabCtl122. The following is the new one that I did.

    Private Sub NextTab_GotFocus()
    Me.TabCtl122.Value = Me.TabCtl122.Value + 1

    End Sub

    Now I have a Compile error when I click on the button. Says "method or data member not found". It then goes to the code and hightlights the second "TabCtl122".

    What did I do wrong this time?
    Thanks again Hans!
    Louise

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Tab Order on tab control form (Office 2000)

    If you type <code>Me.</code> in your module, a list of properties and methods will pop up. Is TabCtl122 among them?
    If it is, press Tab, so that you have <code>Me.TabCtl122</code>, then type a point (period). Another list of properties and methods should pop up. Is Value among them?

  13. #13
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Florida, USA
    Posts
    394
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Order on tab control form (Office 2000)

    Hi Hans,
    No "TabCtl122" is not a choice after typing Me. I stopped there so I never got to the "value" to see if it was there. I don't know why TabCtl122 is not there since that's the name.

    Thanks Hans
    Louise

  14. #14
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Tab Order on tab control form (Office 2000)

    If TabCtl122 is not among the list, it is not on the same form as the command button.

    I'm afraid that troubleshooting this way is going to take a long time. Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

  15. #15
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Florida, USA
    Posts
    394
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Order on tab control form (Office 2000)

    Ok, I've really stripped it down and attached it. The form is the only one left in the database and the "Next Tab" button is on the first page of the control on the bottom right.

    Thanks again Hans!
    Louise

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •