01-07-04, 16:27 #1Registered User
- 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.catkins
01-07-04, 17:03 #2Registered User
- 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 => LostFocusJohn
This is the day the Lord has made, I will rejoice and be glad in it.