Access form/subform: On data entry, new record entry will not begin at first tab fiel

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cambar
    New Member
    • Jul 2010
    • 20

    #1

    Access form/subform: On data entry, new record entry will not begin at first tab fiel

    When Access db is first opened and the first record is entered, tabbing on subform works properly. However, when subsequent records are entered, the subform retains memory of the last field filled in prior record and drops to this field once data is filled in main form. So, if I tab across the main form and expect the first field of the subform to follow, I am disappointed. Cannot figure out how to ensure that after saving a record the tabbing history is cleared and tabbing starts again with the first field. I am not a programmer so any help you can give me will be appreciated.
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    I'm assuming that the Tab Order for your subform is set correctly, which you can check in design view by selecting View, Tab order. If not, then move the control you want to be first to the top of the list in the tab order sheet.

    If there is no problem with the tab order then you will need to do a little programming to ensure that the first subform control always has the focus when moving from record to record, but this is not difficult.

    Open the subform in design view, and in the form's property tabs select the Event tab. Scroll to the On Current event. If it is blank, as I would expect it to be, click in the blank area to select it, then click on the builder button (the one with three dots that appears to the right of the blank box) and select Code Builder. This creates a skeleton of the On Current event for your form.

    In the On Current event, enter the following expression, changing the name of the control to whichever one is the one on your form that you want to be filled in first:

    Code:
    Me![Name of your control].SetFocus
    Save the code page, close the VBE editor, then tryout the form.

    The On Current event is triggered each time you move from record to record. What is shown above should set the focus onto whatever control you want to be shown first, regardless of what the last control was before you moved to a new record.

    -Stewart
    Last edited by Stewart Ross; Sep 11 '10, 08:04 AM.

    Comment

    • cambar
      New Member
      • Jul 2010
      • 20

      #3
      Thanks for your help. Hope to take VBA instruction soon to enable greater utility with Access. Thanks again.

      cambar

      Comment

      Working...