Move cursor to the begining of text in a textbox

S

Song Su

I have a text box called 'txtEmpNo'. When a user click the box, I want the
cursor move to the begining of the text box not where user might click. How
to program that in my form?

Thanks.
 
F

fredg

I have a text box called 'txtEmpNo'. When a user click the box, I want the
cursor move to the begining of the text box not where user might click. How
to program that in my form?

Thanks.

I don't believe you can do that if the user clicks into the control.
The cursor will be where ever the user has clicked.
However, you can set the cursor to the beginning of the control when
ever the user tabs into the control or, using VBA, the control
receives the Focus

Code the Control's Enter event:
Me![ControlName].SelStart = 0
 
Top