Results 1 to 11 of 11

Thread: Shift Tab (XP)

  1. #1
    Lounger
    Join Date
    Feb 2003
    Location
    Clear Spring, Maryland, USA
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Shift Tab (XP)

    On a multi-tab form the Tab key moves from field to field, even to a field on the next tab, but is there a way to use Shift Tab to move to the last field on a previous tab?

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Shift Tab (XP)

    I'm not sure how you have your tab behavior set, but in systems I've developed, the TAB key doesn't take you to the next tab in the tab control, but takes you to the next control in the form tab order. If the Cycle property is set to CurrentRecord it eventually goes back to the first control in the tab order on the current tab. If the Cycle property is set to AllRecords, it goes to the next record and puts focus on the tab after the last form control. The Shift Tab should work the same way but in reverse. Do you have some unusual condition that might make your tab results different? For example, does you form have no other controls except the tab control and it's controls.
    Wendell

  3. #3
    Lounger
    Join Date
    Feb 2003
    Location
    Clear Spring, Maryland, USA
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shift Tab (XP)

    I have nine tab sheets of this form. I have an onlostfocus event on the last field on each tab sheet to call a macro to move focus to the first tab order field on the next tab sheet (otherwise pressing the tab key simply recycles through the fields on the same tab sheet, it doesn't move to the next tab sheet.) Pressing Shift Tab works within the tab sheet, but will not take me back to a previous tab sheet. I don't know how else to change the tab controls any other way.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Shift Tab (XP)

    The best way is to use two unbound textboxes on your subforms, rather than trying to use the lostfocus event. That allows you to respond *only* to the tab or back tab events quite easily.

    Create two unbound textboxes and name them something like txtForward and txtBack. In the tab order, make txtBack the last control and txtForward next to last. Make both of them zero width and set the backcolor and borders to transparent. Then put the appropriate code in their Enter events:

    <pre>Private Sub txtBack_Enter()
    Parent.fsbForm1.SetFocus
    End Sub

    Private Sub txtForward_Enter()
    Parent.fsbForm3.SetFocus
    End Sub</pre>


    You would have to substitute the appropriate subform control names for fsbForm1 and fsbForm3, of course. If you want to fine tune this, you could add the name of the specific control you wanted to set the focus to in a second line after the subform setfocus. Otherwise, the first control in the tab order of the subform will get the focus.
    Charlotte

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Shift Tab (XP)

    I wondered if there was some code being run to make your behavior different from the standard. <img src=/S/bingo.gif border=0 alt=bingo width=15 height=22> What you are attempting to do is fraught with difficulties. For one thing, the tab is primarily a mouse driven type of form to let you quickly jump from one set of controls to another to see more data than would convienently fit on one tab-less form, without serious scrolling. I presume in this case however that you are using the form for data entry, and there things get sticky. With your current situation, suppose that the user decides to grab the mouse and click on some other tab while focus is on the last control of a tab. The form will still set focus on the first control of the next tab - unless the user double-clicks - which is almost certain to cause confusion.

    You could solve your Shift-TAB problem by putting a macro that looks for certain key-strokes, but that's a pretty kludgy approach, and you still have the user confusion issue. What we typically do in these situations is create what looks like a typical Microsoft wizard, and we hide the tabs so the user cannot click on tabs, and give the user Previous, Next and Finished buttons that are only Enabled in the appropriate situations. We include the buttons in the tab order so users can do everything from the keyboard if they choose, but the Tab and Shift-Tab cannot be used to move from "page" to "page" as you proposed to do. Hope this makes some sense - if not feel free to post questions.

    Finally, I'm curious about your application - based on your signature, I might guess it has something to do with church congregation manangement <img src=/S/question.gif border=0 alt=question width=15 height=15>
    Wendell

  6. #6
    Lounger
    Join Date
    Feb 2003
    Location
    Clear Spring, Maryland, USA
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shift Tab (XP)

    I am a pastor trying to design a comprehensive database application in Access for a Christian school in town. I am very new to Access, having used Alpha Software database products for years. I have to say I'm finding Access much more time consuming and confusing. Thanks for the help!

  7. #7
    Lounger
    Join Date
    Feb 2003
    Location
    Clear Spring, Maryland, USA
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shift Tab (XP)

    What exactly do I put in place of: parent.fsbForm1 and parent.fsbForm3? I tried the tab names and the name of the first field on the next page, both to no avail. Sorry for what is probably such an easy question.

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Shift Tab (XP)

    I've attached a zip file containing a sample Access 2000 database demonstrating the process. Access is a much more complex and powerful product that the Alpha line, so don't feel bad about being confused. When you put a subform on a form, regardless of whether you use a tab control, you're actually putting a window on the form that opens into the subform. The subform control (the window) isn't the same thing as the subform itself and may not even have the same name as the subform it contains, so you have to address subforms carefully. The reference to the Parent object means that the subform being referenced is on the main form, not a control nested on the current subform.
    Attached Files Attached Files
    Charlotte

  9. #9
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Shift Tab (XP)

    I usually do something similar, Wendell, but I've built apps where a logical record needed to be displayed (and edited) in multiple pages and the user wanted to be able to tab back and forth through the logical record. Some users are adamantly keyboard-oriented, and this gives them a way to keep working in the record without having to take their fingers off the keyboard. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15> I had one user who even insisted on arrow key navigation, which was much harder to implement in the application in question, since I wasn't using a datasheet. <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15>
    Charlotte

  10. #10
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Shift Tab (XP)

    Well, I got close - as far as Access being confusing and time consuming, it typically is when you are getting started. It involves a number of new concepts, and if your previous experience doesn't involve relational database theory, it's a whole new ball of wax. On the other hand it is IMHO the most powerful desktop database out there, and a very efficient development environment if you want to do client/server designs. Charlotte has given you a technique that we do sometimes use when a user absolutely insists something has to work in a particular way, though her comment dealt with subforms rather than tab pages on a main form. But the same concept applies. My suggestion envisioned a form for lookup and editing of existing records, and a separate form for data entry, which makes your development task more complex. On the other hand, we frequently find that users who demanded a specific keyboard navigation technique often change their mind and begin to use the mouse because it is much quicker to do one or two mouse clicks than 20 or 30 Tab keystrokes. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

    As an after thought, if your system is to be a mission critical part of the school, you may want to look at some robust techniques for doing backup of data. You may want to consider using the MSDE rather than a Jet back-end, or you may want to look at the Small Business Server (SBS) product from Microsoft, which includes a more robust version of SQL Server. Cost may well be a consideration, but SBS isn't terribly expensive for a 5-user system.
    Wendell

  11. #11
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Shift Tab (XP)

    Sorry - I should have read your response to Pastor Doug before I replied to his post. In any event, I don't think he is actually using subforms, at least I didn't find any mention of a subform, so isn't all he really needs to do is to set focus to the appropriate control on the main form, or:
    <font face="Georgia"><font color=blue>
    Private Sub txtBack_Enter()
    Me!PriorControl.SetFocus
    End Sub
    </font color=blue></font face=georgia>
    I suspect event procedures may be a new thing for him too, in which case he could do it with a macro instead. Did I miss something?
    Wendell

Posting Permissions

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