Move cursor to the begining of text in a textbox

  • Thread starter Thread starter Song Su
  • Start date Start date
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.
 
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
 

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

Back
Top