Text Highlighted in Text Box when gets Focus

M

Mossi

I have a form with a Tab Control containing 3 tabs. On
each tab there is just one Text Box. As I select each
tab, all of the text in the Text Box becomes
highlighted. This is very dangerous as pressing any key
deletes the text.

Is there a way of switching this 'feature' off?

Thanks guys...

Ian
 
F

fredg

I have a form with a Tab Control containing 3 tabs. On
each tab there is just one Text Box. As I select each
tab, all of the text in the Text Box becomes
highlighted. This is very dangerous as pressing any key
deletes the text.

Is there a way of switching this 'feature' off?

Thanks guys...

Ian

Set the control's SelStart property.

Code each control's Enter event:
to the end of the data ...
Me![ControlName].SelStart = len(Me![ControlName])
or
to the beginning ...
Me![ControlName].SelStart = 0
 
G

Guest

Excellent, thanks Bill, it worked a treat. I added the NZ
() function to cater for blank fileds.

Me![ControlName].SelStart = Nz(len(Me![ControlName]))

Thanks again.

Ian
-----Original Message-----
I have a form with a Tab Control containing 3 tabs. On
each tab there is just one Text Box. As I select each
tab, all of the text in the Text Box becomes
highlighted. This is very dangerous as pressing any key
deletes the text.

Is there a way of switching this 'feature' off?

Thanks guys...

Ian

Set the control's SelStart property.

Code each control's Enter event:
to the end of the data ...
Me![ControlName].SelStart = len(Me![ControlName])
or
to the beginning ...
Me![ControlName].SelStart = 0
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 

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