Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    88

    Unanswered: Control Focus after Refresh / Requery

    I have an AfterUpdate event for a control that exists on a subform (continuous form). The Afterupdate code recalculates controls for the current record. In order for the update to the table to take place, it appears that I need to do a Refresh. My problem is that after the Refresh, the Focus repositions itself to the 1st tab position on the subform. (I am using the Refresh so that the Table update takes place, unless there's another method available) (Access 2002 'adp')

    eg. Change is applied to Control3 on subform
    Use Tab to advance to next field (Control4 on subform)
    AfterUpdate event fires for Control3
    After REFRESH, focus is now on Control1 instead of Control4

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    Seems like you have the Me.Refresh within the AfterUpdate for Control3 on SubForm. Directly benieth it enter the code Me.Control4.SetFocus. For Example:

    ....Code.....
    ....Code.....
    Me.Refresh
    Me.Control4.SetFocus


    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  3. #3
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    88
    The problem lies in knowing what the next control is. For example, they may have clicked the SAVE button instead of using the tab key, or they could also use the down arrow in the continuous form. Is there a way to bypass the refresh, or does that actually update the underlying table?

  4. #4
    Join Date
    Nov 2003
    Posts
    1,487
    Set focus to whichever control you want through the OnCurrent event of the actual SubForm itself (not the SubForm control).

    Is the subForm in datasheet view?
    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  5. #5
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    88
    No ... it's a continuous form.

Posting Permissions

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