Text Box Question

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!
 
J

Jim Allensworth

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
 
R

Rhonda Floyd

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top