SetFocus to Other Control After Picking/Clicking from DatePicker (1 Viewer)

jmq

Registered User.
Local time
Yesterday, 21:04
Joined
Oct 4, 2017
Messages
87
I want to move the cursor or set the focus to other control after i click or pick a date from the date picker.

i get error 2110 with this code:

Code:
Private Sub txtStart_AfterUpdate()
    DoCmd.GoToControl "txtEnd"
    txtEnd.SetFocus
End Sub
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 00:04
Joined
Feb 19, 2002
Messages
43,592
Use

Me.txtEnd.SetFocus

However, attempting to control movement this way can get pretty tedious pretty quickly. If you train the users to tab from control to control, you can use the tab order property to specify the sequence of controls. The first control (the one that gets the focus when the form opens) is 0. As you move controls around or insert new controls between others, the tab order gets messed up. There is an option to just have Access set the order based on the controls' position left-to-right, top-to-bottom.
 

Users who are viewing this thread

Top Bottom