Cursor Placement

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

Guest

Hello all,

Is there a way (using VB) to force the cursor to move to the end of text
when a field has the focus.

I have the following code which puts the cursor at the start of the field,
but I want to cursor to be at the end of the field:

Private Sub FirstName_GotFocus()
Me!FirstName.SelStart = Me!FirstName.SelLength
End Sub

There does not appear to be a reverse action for SelStart in VB Help which
seems odd.
 
Hello all,

Is there a way (using VB) to force the cursor to move to the end of text
when a field has the focus.

I have the following code which puts the cursor at the start of the field,
but I want to cursor to be at the end of the field:

Private Sub FirstName_GotFocus()
Me!FirstName.SelStart = Me!FirstName.SelLength
End Sub

There does not appear to be a reverse action for SelStart in VB Help which
seems odd.

Me!FirstName.SelStart = Len(Me![FirstName])
 
Fredg,

Wow that was really fast on the draw. Thanks a million :-)

fredg said:
Hello all,

Is there a way (using VB) to force the cursor to move to the end of text
when a field has the focus.

I have the following code which puts the cursor at the start of the field,
but I want to cursor to be at the end of the field:

Private Sub FirstName_GotFocus()
Me!FirstName.SelStart = Me!FirstName.SelLength
End Sub

There does not appear to be a reverse action for SelStart in VB Help which
seems odd.

Me!FirstName.SelStart = Len(Me![FirstName])
 
Back
Top