Conditional Formatting in Continuous Forms

marrett

Registered User.
Local time
Today, 13:37
Joined
Sep 8, 2000
Messages
43
Hi,

1 need to Change the color on 7 fields based on the value of one field.

Basically if there is a company in the company field I need ti change the address field to a different color.

Thnaks,

Maria
 
Use the Search button here, I'm sure you'll find enough answers to help you
 
In the "OnGotFocus" event of the control, type in this code:

If Not IsNull(Me.CompanyField).Value <> Null then
Me.OtherFieldName.BackColor = Value Of Your Color
Me.OtherFieldName.Requery
EndIf

For the value of your color, do some research on RGB colors.
You'll have to provide a combination of 3 numbers here, one for each color. (There is another way to do this though, but maybe just as involved)

Have done this once, but let me know if it doesn't work and I'll spend more time on it.


edtab
 
Last edited:
Conditional Formatting

Thank for responding!

I tried that but it didn't do what I need. I will try to be clearer.


I have written a program that grays out fields that cannot be edited.

Problem:

I have a continuous form that has different addresses in it. If there is a company name the address cannot be edited, but if there is not company name you can edit the address.

When the form opens I need the address field only on those records that have company ids to be grayed out.

If you can help will be so thankful.

Maria
 
FormCurrent
If IsNull(Me.MyCompany) Then
Me.MyAddress.Enabled=True
Else
Me.MyAddress.Enabled=False
End If
 
thanks for helping

Thank you for taking your time to help me. i still could not get it to work so I did it a different way. I made the fields transparent and put the company filed behind and changed the color if the company field in stead. so now I have several fields set = to the company name.. It wasn't how I wanted to do it. But it fixed the problem.

Thnaks again,
Maria
 

Users who are viewing this thread

Back
Top Bottom