changing textbox backgrund color

saleemMSMS

Registered User.
Local time
Tomorrow, 03:26
Joined
Aug 12, 2009
Messages
92
i have more than 50 forms with more than 10 text boxes in each. i want to make the text box color yellow when its active and white when its inactive.
rather than writing code to each and every text box's got focus and lost focus events, is there any other easy way to perform this ?? :cool::cool:
 
the code should be integrated into each and every event. so it seems impossible in this way...
 
You'll still have to do this for each form, but it's much quicker than coding each control in each form:

Open a form in Design View
Holding down the <Shift> key, select each control (textbox) to do this to
Goto Format - Conditional Formatting
In the left-most dropdown box, select Field Has Focus
Click on the 'paint bucket' icon
Select Yellow
Click on OK

You're done!

Repeat this 49 more times! Sorry, but I've never seen this done, universally, thru code. But at least, on future databases, you'll know to do this when you create forms.

Good luck!
 
the only other way is to step through all ther controls on a form (eg in the form open event) and set everything at that time. This is not slow at all, if its appropriate.

dim ctrl as control
for each ctrl in me.controls then etc
next
 
the only other way is to step through all ther controls on a form (eg in the form open event) and set everything at that time. This is not slow at all, if its appropriate.

The OP is talking about changing the textbox backcolor when it gets the focus; how would setting the formatting in the Form_Open event work?
 

Users who are viewing this thread

Back
Top Bottom