Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

High light text boxes 2

Status
Not open for further replies.

kpryan

Technical User
Aug 24, 2005
282
US
Hi all,
When the cursor enters a text box etc, how can code be arranged to highlight that box. So the user can know where he is at any time?

many thanks,

Ken
 
for tabbing or entering into a field, go to Tools, Options, Keyboard, and make sure "Select Entire Field" is selected.
 
''on the on gotfocus event for the text box put the code

me.text1.backcolor = vbgreen 'Color you want'

' the backcolor can be either vbwhite, vbyellow etc or a number that corresponds to the color you want.

''on the on lostfocus event for the text box put the color back to its original state.

me.text1.backcolor = vbwhite

'' if you have a lot of controls on the form you can do other things but this will get you going.
 
Hi all,

Many thanks for your replies. The forms I are continous forms. On that code you gave it highlights the whole column. Is there a way to stop this. Only to highlight a single field at a time?

Ken
 
I found the answer to this porblem. I used the condional formatting and it works ok.

Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top