Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SET FOCUS (Access 2002)

    I'm using SetFocus on the AfterChange Control on my SubForm to move the Control to the next field. The SubForm's Default View is set to 'Continuous Forms'; when I enter on the second record of the continous form the focus is moved to the field I desired; however it moves the focus to the first record. If I'm on the second record I want the focus to be set to the field on that record; not the field on the first record. What I'm I doing wrong. I wrote "HrlyRateOVR.SetFocus"; where "HrlyRateOVR" is the name of the field.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: SET FOCUS (Access 2002)

    Could you post the complete event procedure? There is no After Change event.

  3. #3
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SET FOCUS (Access 2002)

    Sorry about that; it's the "After Update" Event;
    Me![Userid] = gsUserName
    Me![Update] = Date
    Me.AccrualAmtGrs = AccrualAmtGrs2
    Me.AccrualAmtSB = AccrualAmtSB2
    Me.Hrs921 = Hrs9212
    Me.Recalc
    HrlyRateOVR.SetFocus

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: SET FOCUS (Access 2002)

    Could you please post the complete event procedure, including its first line?

  5. #5
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SET FOCUS (Access 2002)

    Private Sub HrlyRateOVR_AfterUpdate()
    Me![Userid] = gsUserName
    Me![Update] = Date
    Me.AccrualAmtGrs = AccrualAmtGrs2
    Me.AccrualAmtSB = AccrualAmtSB2
    SBRateOVR.SetFocus
    'Me.Refresh
    'Me.Requery
    Me.Recalc


    End Sub

    I changed it a bit just to see if it would matter where the setfocus cmd was listed.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: SET FOCUS (Access 2002)

    The commented out instruction Me.Requery would set the focus to the first record, because it reloads the record source. Me.Refresh and Me.Recalc should not have that effect. I see nothing else in your code that would set focus to the first record. Do you have any event procedure for SBRateOVR?

Posting Permissions

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