INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Access Howto:

How do I get different coloured text for records by Frink
Posted: 22 Jan 02

If you have a field [strStatus] in a table which can have values of "On" or "Off", and you want "Off" records to appear in Red text and "On" records to have Green text, this is the FAQ for you.
Unfortunately, these values cannot be edited.

Make several copies of the field you want coloured, give them all the same size and position. Give them sensible names, like txtStatusOn, txtStatusOff. Make each one transparent, with a foreground colour set to the colour you want. You might want to make the fields disabled and locked.
In each controls Control Source put:

=IIf([strStatus]="On",[strStatus],"")

for the Green one, and

=IIf([strStatus]<>"On",[strStatus],"")

for the Red one.
These field will be empty unless the IIf expression is True, in which case it would appear as the text in the required colour.

Now open the form. All Status fields with a status of On will be in Green text, and all others will be in Red.

Hope that makes your forms prettier,


- Frink

Back to Microsoft: Access Other topics FAQ Index
Back to Microsoft: Access Other topics Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close