Text Box Question

  • Thread starter Thread starter Rhonda Floyd
  • Start date Start date
R

Rhonda Floyd

In a form in Access 97, when a user clicks in a Text Box the cursor remains in the position where they clicked on. I was wondering if there's a property or something that can be set when the field is entered that the cursor will default to the beginning of the text field (left if text or right if numeric).

Any help will be greatly appreciated.

Thank you!
 
Use the SelStart method. Like...

'When the textbox is clicked with the mouse:
Private Sub txtBox_Click()
Me.txtBox.SelStart = 0
End Sub

'When the user tabs into the textbox:
Private Sub Text2_GotFocus()
Me.txtBox.SelStart = 0
End Sub

- Jim
 
Thank you. That works perfect.

Thanks again!

Use the SelStart method. Like...

'When the textbox is clicked with the mouse:
Private Sub txtBox_Click()
Me.txtBox.SelStart = 0
End Sub

'When the user tabs into the textbox:
Private Sub Text2_GotFocus()
Me.txtBox.SelStart = 0
End Sub

- Jim
 
Back
Top