SelStart Property Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

When a user enters a control I want to be able for the Cursor to start at
the first position.

So I have...

Private Sub txtName_GotFocus()
txtName.SelStart = 0
End Sub

This works. However when I do the same for a ComboBox control it doesnt
work when the user "Clicks" on the ComboBox. It highlights the 1st position
but doesnt move the Cursor to the 1st position.

I have..

Private Sub cmboFromDate_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
cmboFromDate.SelStart = 0
End Sub

How can this be done with a Combo Box ?

Any help would be greatly appreciated.

Thank you,
Jeff
 
you need to use setfocus to move the cursor to the control

Me.txtName.SetFocus
txtName.SetFocus
cmboFromDate.SetFocus

'you can use me. or the name of the form name or like how u did it without
any form
'name just the name of the control.
 
Back
Top