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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Proplem with Conditional formatting in access 2003?

Status
Not open for further replies.

neemi

Programmer
May 14, 2002
519
GB
Does anyone know if there is a bug with conditional formatting in Access 2003 where all of the records receive the formatting from the last condition even if the condition is not met?

I am using an expression to highlight the [TextBoxA] fontcolor to red if [textBoxB]>[TextboxC]!! But the formatting is going all funny!!! Arrrgghhh

And when i am in the CF screen when I select a colour for the font... say for example condition 2 and then the mouse moves over the font color selection for condition A it changes it to the condition 2 font color, (even without me selecting it!!!!

Have people had similar problems with this?
Is this a known bug?
What could it be?
How can i resolve this?

Please advice as i am the most critical part of this system design which is being able to apply the CF!!! and it don't bloody work!!!

Thanks in advance.
Neemi
 
OK... I have sorted the above problem but i am now tryin to add CF via code as i have a numerous amount of feilds I need to add the conditions to...


I have got the code to work in the sense that it runs through it without error, however no CF's can be seen on the fields!!!

can comeone tell me if I am missing something here...

the code I have is as below..

Code:
Dim i As Integer
Dim objFrc As FormatCondition
    
    For i = 1 To 12
        Debug.Print Me.fsbResourceDetails.Form("Col" & i & "_D").ControlSource
        Me.fsbResourceDetails.Form("Col" & i & "_D").FormatConditions.Delete
        'With Me.fsbResourceDetails.Form("Col" & i & "_D").FormatConditions.Add(acExpression, , "[total_" & Me.fsbResourceDetails.Form("Col" & i & "_D").ControlSource & "]<GetCFDayMin()")
        '    .BackColor = 16777164
        '    .ForeColor = 0
        '    .FontBold = False
        'End With
        Set objFrc = Me.fsbResourceDetails.Form("Col" & i & "_D").FormatConditions.Add(acExpression, , "[total_" & Me.fsbResourceDetails.Form("Col" & i & "_D").ControlSource & "]<GetCFDayMin()")
        Set objFrc = Me.fsbResourceDetails.Form("Col" & i & "_D").FormatConditions.Add(acExpression, , "[total_" & Me.fsbResourceDetails.Form("Col" & i & "_D").ControlSource & "]>GetCFDayMax()")
            
        With Me.fsbResourceDetails.Form("Col" & i & "_D").FormatConditions(0)
            .BackColor = 16777164
            .ForeColor = 16711680
            .FontBold = True
        End With
        With Me.fsbResourceDetails.Form("Col" & i & "_D").FormatConditions(1)
            .BackColor = 16777164
            .ForeColor = 255
            .FontBold = True
        End With
    Next i
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top