Link to home
Start Free TrialLog in
Avatar of Lukasz Chmielewski
Lukasz ChmielewskiFlag for Poland

asked on

Access Controls

Hi. I have an Access 2010 Form, on which there are plenty of controls (textboxes), let's say that their names are TB1, TB2, TB3, ..., TB50. Is there a way to know which one was clicked ?

I want to change the textbox backcolor to different one, but I don't want to place 50 functions of TB*_click event. Hope I'm clear. Please ask if not.
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

I would recommend conditional formatting.  Select all of the textboxes at once, then click conditional formatting on the ribbon.  

In the dropdown associated with Condition1, select "Field has Focus", then set the background color you want the control to have when it gets the focus.
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lukasz Chmielewski

ASKER

That's it, thanks a lot !