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!

Change colour of text when a drop down menu changes

Status
Not open for further replies.

Viv1

Programmer
Dec 9, 2003
42
GB
Hello,

I have 2 fields on my form called 'MembershipNo' and 'Status'. I would like the 'MembershipNo' to turn red and bold when the 'Status' is not 'Live'. I have done this but it changes ALL 'MembershipNo' fields to red regardless of what the status says.

I have the following code:

If Me!Status <> "Live" Then
Me!MembershipNo.ForeColor = 255
Me!MembershipNo.FontBold = True
Else
Me!MembershipNo.ForeColor = 0
Me!MembershipNo.FontBold = False

Is there a way to make only the current record change? Also, rather than AfterUpdate() is there a way to change all the records (4000) when the form opens? I have tried FormLoad and this doesn't do anything.

Many Thanks, Viv
 
Check out Conditional Formatting, from the format menu in stead - available in 2000+ versions.

Roy-Vidar
 
Hi,

Thanks for the suggestion. I just tried this but unfortunately it changes all records again regardless of whether they meet the condition or not.
 
Usually, when set up correctly (the control used as criterion (the "Status" control - btw - if it's a combo, are you sure the bound column returns "Live"?) is bound to a field in the recordsource), it will behave as you whish, but it's hard to make any comments without knowing what you've done/how you've set it up/if you've removed the existing code... faq181-2886 #14 details a little about how to get the best answers.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top