Text Highlighted in Text Box when gets Focus

  • Thread starter Thread starter Mossi
  • Start date Start date
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
 
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
 
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.
.
 
Back
Top