Unanswered: Conditional Formatting in Controls on a Report
I have a Report based on a query with Approx 63 fields on it. (Five Genereation Pedigree) I need to be able format the text of either the primary Text box or subsequent 62 combo boxes to Red if the Champion field (yes/no) is checked. I have tried help and am having difficulty in syntax and using Build etc.
Primary Text Field is called DogName
Subsequent combo box names are
Any Assistance would be greatful.
Basicly, if any dog on the pedigree has a check in the Champion box I need the font in the control they are in to appear in red.
Thank you SOOOOOOOO MUCH I really apreciate it. . . I do have one question if you have a chance. Is there a way to do it through Code and Loop the search on all the controls as opposed to putting that expression on Every control?
Actually that only half worked. The champion on control on the form/report is in reference to the initial dog. The subsequent 62 dogs are it's ancestors.
my set up is like this
With what you directed me to, if the initial Dog on the form/report is a champion. . . all dogs will show in red. What I need is for the dogs to show in red ONLY IF for the value in the field' Champion is "true". Does that make sense? I hope I explained it correctly. IF there are 7 dogs on the form/report for a particular dog's pedigree that is a champion . . . then I need only those seven to show. Right now the expression is looking if the check box on the current form/report's record is showing as true. What I need it is to refer to the table and if that specific dog in the table has champion checked in it's own record. . .then I need it to show as red.
I hope that wasn't too confusing. . . I could upload or email my db if you care to look at it and if you are willing to help. Please let me know.
Thank you for the link though. . . I was wondering how to get some of that to work.
For Each mycontrol In Forms("myForm").Controls
'If Left(mycontrol.Name, 3) = "chk" Then
' you can get FormatConditions only for TEXT and CheckBox Controls....
' I name all my check boxes CHKsomething.....
Debug.Print "there are : " & mycontrol.FormatConditions.Count & " conditions on " & mycontrol.Name
If mycontrol.FormatConditions.Count = 0 Then
'if there are no conditions, I ADD one.....
mycontrol.FormatConditions.Add acExpression, , "[myCondition] = 15"
For i = 0 To mycontrol.FormatConditions.Count - 1
Debug.Print " Condition " & i & " is " & mycontrol.FormatConditions(i).Enabled
Debug.Print " Condition " & i & " expr1 " & mycontrol.FormatConditions(i).Expression1
Debug.Print " Condition " & i & " expr2 " & mycontrol.FormatConditions(i).Expression2
Debug.Print " Condition " & i & " backcolor " & mycontrol.FormatConditions(i).BackColor
Debug.Print " Condition " & i & " ForeColor " & mycontrol.FormatConditions(i).ForeColor
Debug.Print " Condition " & i & " FontBold " & mycontrol.FormatConditions(i).FontBold
' other properties are FontItalic, FontUInderlined, Type, Operator
WOW I will check this out and give it a shot. I am not all that up on coding so that looks a bit intimidating. I am currently using Access 97 at work. . .2K at home Hopefully at end of month I will have new computer with XP etc so cross your fingers.
I do have one question should you have the time . . you said. . .
" you can get FormatConditions only for TEXT and CheckBox Controls...."
Does this mean the combo boxes can't be formatted or am I misunderstanding what you commented there please?