Changing background color of text boxes

aqif

Registered User.
Local time
Today, 23:44
Joined
Jul 9, 2001
Messages
158
Hi
smile.gif


I have got a form in which I have about 30+ text boxes with number either '1' or '0'. What I want to do is at Form Current event or any other event, all the text boxes having '0' value should show as black in background and all the text boxes with value '1' should appear in red background. I know how to change back color etc but can't able to figure out a code whuch will work for all text boxes on the form. The other option is to write IF conditions for every text box which is very time consuming and difficult to maintain too.

Any suggestions?

Cheers!
Aqif
 
Select a field and go to Format > Conditional formatting and from the first combo on the left select 'Field Value Is' and type in 0 and select a colour. Do it again for 1, with the other colour. Do the same for all fields you need to do it with.

HTH

Scott.
 
What version of Access are you working in?
 
Yes Stephen:

Thats what I was thinking tht this Conditional formating feature was not available in Access 97. So will it run if I will save my DB in prior version is remains to be seen. But i was looking for a code which sort of loops through every text box n sets formating...any suggestions
smile.gif
?

Cheers!
Aqif
 
Sorry, I haven't got the specific code you need right now. I'm working on something similar myself (regarding conditional formatting) and I've learned the code I have so far by trial and error. When I accomplish what I'm trying, I can email you if you like.
 
Yes Please
smile.gif


I will like to see the code. Please mail me at

mukhtar@dph.uwa.edu.au

Cheers!
Aqif
 
Sure thing, I've put you in my address book. If you don't hear from me in a while, drop a note.

And if you come up with anything that works, please let me know.

Stephen
 

Users who are viewing this thread

Back
Top Bottom