Results 1 to 11 of 11
  1. #1
    bsc is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2011
    Posts
    28

    Thumbs down Form/Subform Tab Behavior

    This is dificult to explain. I have a form that users fill out. as they tab through fields eventually they get to a sub form which is linked with the main form. In the case of new record entry the main form is dirty. When the sub form is entered via a tab key being pressed the main form saves the record (thus resorts) and moves off the record that was being entered. This confuzes users and I cannot seem to find a way to make the main form stay on the record being entered.



    If the record is not dirty, the tab moves into the subform without problem, staying on the record in view.

    Any help would be appreciated.
    bc

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    this might be a problem related to your record cycling. check that. although I think that only relates to a single form, not a linked sub.

    the obviously fix though, would be to shut off the tab stops in the subform. But I don't really remember this happening. I'm guessing it's a property somewhere on your form.

    did you make an auto form for a parent table that is involved in a parent-child relationship? If you did, the link is created automatically with the auto form.

  3. #3
    bsc is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2011
    Posts
    28
    I did not use auto form but the subform table is involved in a one to many relationship. Interestingly, when creating a new main form record, one can use the mouse and click into the subform and it works fine. Only when tabbing into the subform does the main form revert to the first record.

    Also the main form is a split form and what I have also noticed is that the split window (table) view stays on the record being entered but only the other half and the subform reverts to the first record. Weird.

    There are other subforms on here also for view only. I'm thinking I may have to separate the forms since there are a lot of event driven vba actions which I could easily upset by strategically adding a gotorecord command somewhere.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    As Adam said, check the Cycle Property on the Other tab of the property sheet for the MainForm.

  5. #5
    bsc is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2011
    Posts
    28
    Thanks for the clarification. The cycle property was set to "All Records". I tested behavior with the other two options and the result is the same.

    If it helps,I have attached a jpg of the event right after tab is pressed from the "Internal Comments" field.

    Forms are linked on NCMR No....this shows that the record has jumped to the first logical record in the table and the subform has followed. However in the table view of the split form the record selected is the one I was editing.

    I recal reading a thread on split forms getting out of sync and know that there are other well documented bugs with them...not sure if there is a relationship with this issue. I'm currently looking through all VBA code and events for record pointer commands that may be doing this.

    Windows 7/ Access 2010 64 bit

  6. #6
    bsc is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2011
    Posts
    28

    Thumbs up

    This seems to have mitigated the issue thus far. On the last tab stop, lost focus event...

    Private Sub IntlComments_LostFocus()
    DoCmd.RefreshRecord
    DoCmd.GoToControl "NCMR_Discrepancies"
    End Sub

    Thanks for your support.

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Did you try changing the Cycle property to "Current Record"?

  8. #8
    bsc is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2011
    Posts
    28
    Yes, as stated earlier, I found the cycle property was set to "All Records". I tested behavior with the other two options and the result was the same.

    The lost focus event I wrote for the last tab stop, more or less, forces the behavior I was expecting. This may seem to be a bit clunky. What do you think? It works.

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Changing the Cycle Property to Current Record should have worked for what you described.

  10. #10
    bsc is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2011
    Posts
    28
    Once I understood the Cycle property I thougth it should be too. But it did not. I even went through all the sub form tables and explicitly ordered them in a way that should have caused the latest record to display in the event of a refresh or requery, and still, as the attached jpg shows, things get jumbled on the last tab stop.

    The problem seems to be casued by an event sequencewhen leaving the main form because if I use the mouse and click into the sub form during record creation, it works fine. Also looking at existing records, I can either tab into the subform OR use the mouse to click into the sub form without issue. It only happens when the new record has not been saved yet and the sub form is tabbed into. Curious.

    Since lost focus is the last event, I know of, when moving from one control on to another, I thought it would be a good point get my way.

  11. #11
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The SubForm is in the tab list and is probably the next control after the control where you changed the Exit event. Regardless of how you move the focus from a mainForm to a SubForm, if the MainForm Recordset is Dirty then it *will* save the current record. Now that I think about it, changing the ctcle property will not work in this case because the SubForm is still the next tab stop for the focus.

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

Similar Threads

  1. Resizing Forms (Properties affecting behavior)
    By ajetrumpet in forum Tutorials
    Replies: 0
    Last Post: 07-17-2011, 04:05 PM
  2. "Enter Key Behavior" weirdness
    By EvanRosenlieb in forum Forms
    Replies: 1
    Last Post: 06-27-2011, 05:15 PM
  3. Behavior of the "Enter" key on textbox
    By Grooz13 in forum Forms
    Replies: 1
    Last Post: 01-13-2011, 03:00 PM
  4. Strange Behavior when Sorting
    By geniass in forum Queries
    Replies: 5
    Last Post: 09-02-2010, 03:53 PM
  5. MS Access Enter Key Behavior
    By RAPSR in forum Programming
    Replies: 0
    Last Post: 12-23-2007, 02:31 PM

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