Select the entire field.

J

Joe

Let me clarify my question,
In most of the fields when I click on it, it should not
select the entire field.
Only one field, when I click on it I want the entire field
to be selected, so I will override the old information.
Please help
Thanks
Joe
 
D

Dirk Goldgar

Joe said:
Let me clarify my question,
In most of the fields when I click on it, it should not
select the entire field.
Only one field, when I click on it I want the entire field
to be selected, so I will override the old information.
Please help
Thanks
Joe

I'd use the control's GotFocus event. Here's air code:

Private Sub txtMyTextBox_GotFocus()

With Me!txtMyTextBox
.SelStart = 0
.SelLength = Len(.Text)
End With

End Sub
 

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