SetFocus to Other Control After Picking/Clicking from DatePicker

jmq

Registered User.
Local time
Today, 06:30
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
 
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

Back
Top Bottom