Results 1 to 8 of 8
  1. #1
    SunTop is offline Advanced Beginner
    Windows 8 Access 2016
    Join Date
    Aug 2016
    Posts
    93

    Tab Order in a Form with a SubForm


    Hello everyone
    I have a Form with a Subform in it. I am trying to setup the Tab order, but every time the cursor moves to the Subform it skips a field and goes directly to the next one. Why is this happening ?

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    You set the tab order for the subform the same way you do for the main form, you can edit the order in the design view of the subform. As long as your 'enabled' property is set to true you should hit the fields in the order you specify

  3. #3
    SunTop is offline Advanced Beginner
    Windows 8 Access 2016
    Join Date
    Aug 2016
    Posts
    93
    I did setup the order tab in the design view for both my main and sub forms and the ‘Enabled’ property is set to true for every control item in both forms, but still when the cursor moves to the subform it skips the first field and goes right into the second one, I can’t figure why it is doing this ?

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    I would need to see a sample database, 'auto order' if you used it does not necessarily arrange things in the order you want them.

  5. #5
    SunTop is offline Advanced Beginner
    Windows 8 Access 2016
    Join Date
    Aug 2016
    Posts
    93
    Hello rpeare

    Thanks for your reply

    https://drive.google.com/file/d/0B9y...ew?usp=sharing

    This is a sample database, the form in question is called Accidents and the sub form is called AccidentDetails. When you start entering data in the form, the first round (record), the cursor moves in the correct order but starting from the second round, when the cursor enters the sub form it skips the CompID field and starts directly in the Quantity field.

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    Ok here's what's going on. When you use tab to get out of the subform access is 'remembering' where you were in the subform and preserving that for when you go into it again, you'll notice the first time you enter the subform it correctly goes to the first field. You can counteract it with:

    DoCmd.GoToRecord , , acNewRec
    DoCmd.GoToControl "compid"

    in the ON ENTER property of your subform

  7. #7
    SunTop is offline Advanced Beginner
    Windows 8 Access 2016
    Join Date
    Aug 2016
    Posts
    93
    Thank you rpeare,
    You have solved my issued.
    God bless you Sir.

  8. #8
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Since Location is required in form Accidents, put this in the AfterUpdate of the Location field:

    Forms![Accidents]![AccidentDetails Subform].Form![CompID].SetFocus

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

Similar Threads

  1. Replies: 2
    Last Post: 03-07-2016, 05:02 PM
  2. Replies: 3
    Last Post: 02-09-2016, 04:36 PM
  3. Allow more than order in an ORDER form.
    By kiko in forum Access
    Replies: 37
    Last Post: 04-19-2013, 05:30 AM
  4. Replies: 1
    Last Post: 03-10-2013, 12:49 AM
  5. Replies: 1
    Last Post: 11-07-2010, 11:04 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