Results 1 to 5 of 5
  1. #1
    oleBucky's Avatar
    oleBucky is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2011
    Location
    Inside the Loop
    Posts
    100

    Tabbing from subform to subform when entering data


    I have a form with 5 subforms. All 6 forms have essential data entry boxes. The tab stops work fine when jumping from the main form to the first subform. Not so when jumping from the first subform to the second subform.

    When tabbing out of the last data entry text box on the first subform, how would one go about having the cursor jump to the initial tab stop on the second subform? Second to third and so forth?

  2. #2
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    You might try something like this in an after update or on exit event in the last control in the subform...

    Dim strSubformControlX As String
    strSubformControlX = "NameofSubform"
    DoCmd.GoToControl strSubformControlX
    DoCmd.GoToControl "Nameoffirstcontrolonsubform"

    Repeat for each subform, change name of the subform and var accordingly.

    However, you may also have to address the circumstance where the user doesn't follow the normal flow of the form.

    All the best !

  3. #3
    kennejd is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    188
    Put this on the 'on exit' event of the last control of each subform:

    SendKeys "^{TAB}"

  4. #4
    oleBucky's Avatar
    oleBucky is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2011
    Location
    Inside the Loop
    Posts
    100
    The SendKeys code works! Great! I would have NEVER come up with that code.

    However, it makes the values on the subform you are tabbing from go blank. It does not erase the values in the table that serves as a record source for the form, it just makes the values in the form disappear.

    I, in my brutish way, got around this by adding a Requery to the "On Enter" for the form tabbed into. Might there be a more "elegant" way to do this? Otherwise, I will consider this issue solved!

  5. #5
    kennejd is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    188
    I would probably use the requery method too....inelegant but effective...

    I'm not sure why the values are blanking out, though....I can't duplicate that in my database.

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

Similar Threads

  1. Pass Subform filter to subform in report
    By camftm in forum Programming
    Replies: 16
    Last Post: 07-19-2011, 07:12 AM
  2. Replies: 1
    Last Post: 03-15-2011, 03:53 PM
  3. Replies: 15
    Last Post: 11-09-2010, 04:27 PM
  4. Data from one subform to anther subform
    By scotribs in forum Forms
    Replies: 3
    Last Post: 03-09-2010, 09:53 AM
  5. Replies: 1
    Last Post: 12-10-2005, 04:52 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