conditional formatting

sullivan

Registered User.
Local time
Today, 06:41
Joined
Apr 24, 2001
Messages
48
I am trying to use conditional formatting on a subform, but it's not working. This is what I'm doing:

In the conditional formatting dialog box I choose "Expression Is" from the formatting criteria drop down list. Then I entered [Forms].[WindowTreatmentQuerysubform]![Original?]=False

I want the text box to change font color if the Original? check box returns a false value (is not checked). Nothing is happening though. What am I doing wrong?
Thanks in advance.
 
On the On Current property of your form, enter the following event procedure The Data in caps you will need to change to fit your database:

If Me.YOURCHECKBOX = 0 Then
Me.YOURTEXTBOXYOUANTTOCHANGECOLOR.BackColor = vbRed 'makes BG Red
Else
Me.YOURTEXTBOXYOUANTTOCHANGECOLOR.BackColor = vbWhite 'makes BG White
End If

Audrey
smile.gif
 
Thank you for your suggestion. I'm sorry, but I'm very frustrated. I don't know if I have a different version of Access than you, but the property sheets of my text boxes do not have On Current, they have On Enter, On Exit, etc, but not On Current.

I don't want to change the check box's features, I want to change the other text boxes on the form. If the check box is checked then nothing should happen, if it is left blank I want to change the font color of the coresponding text boxes. I thought the conditional formatting option that is new to Access 2000 would do this but my expression is not working.
 
Put the above mentioned code into the On Current property of the FORM. This code will change the color of the TEXTbox according to if the CHECKbox is checked or not. It will NOT change anything on the CHECKbox.
 
Try:

[Forms].[WindowTreatmentQuerysubform].Form![Original?]=0

0 = False

If your are working on the same forms as your form source,

[Original?]=0

should work.

HTH,

Lyn
 
Okay, you guys have been great help. I'm going to look like a fool, but I'm trying to follow the steps you gave me, and what my books say, but I'm not getting the results I want - actually I'm not getting any results.

In the properties sheet of the subform, On Current, I chose to enter new code and put in this:
Private Sub Form_Current()
If Me.Original = 0 Then
Me.Legend_Code.ForeColor = vbGreen
Else
Me.Legend_Code.ForeColor = vbBlack
End If
End Sub

Then I close the code window, open the form in form view, to see if it worked. Nothing happens. Does anyone see what I'm missing?
Thanks again.
Jennie
 
Sullivan,

My post was in reference to your initial post.

Quote:
_____________
In the conditional formatting dialog box I choose "Expression Is" from the formatting criteria drop down list. Then I entered [Forms].[WindowTreatmentQuerysubform]![Original?]=False
_____________

I think the problem is with referencing your check box so I suggested the following:

[Forms].[WindowTreatmentQuerysubform].Form![Original?]=0

I also suggested that instead of "False", it should be 0, since 0=False and -1=True.

Prior to posting I have tested this method, on my A2K machine and it worked properly. I also use this feature since this works great in a continous view and single form view of a form.

The technique suggested by Audrey is a different approach.

HTH,

Lyn
 

Users who are viewing this thread

Back
Top Bottom