Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003

    Unanswered: setfocus not repositioning cursor

    Why is setfocus not returning cursor to form object ?

    I am using Access 2000, Sp 3. After finding an error in data entry I want to reposition the cursor at that text box, & use the following bit of code:

    Select Case True
    Case Me.txtSeqChar <> "A" Then
    MsgBox ("Certification Sequence No. not = A")

    After the message box is closed the cursor is at the next form object, not at Me.txtSeqChar. I have tried me.repaint & me.refresh without success.

  2. #2
    Join Date
    Jun 2002
    Mpls/St.Paul area
    The event you are using is important.

    If your code is triggered on OnExit, then you are
    already leaving and it will not let you set focus on
    the control you are leaving (because you are leaving).

    The following is right out of Access Help.

    When you enter or change data in a control on a form and
    then move the focus to another control, the BeforeUpdate
    and AfterUpdate events occur:

    BeforeUpdate => AfterUpdate

    The Exit and LostFocus events for the changed control occur
    after the BeforeUpdate and AfterUpdate events:

    BeforeUpdate => AfterUpdate => Exit => LostFocus
    This is the day the Lord has made, I will rejoice and be glad in it.

Posting Permissions

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