Conditional format a calculated field

  • Thread starter Thread starter Kelly
  • Start date Start date
K

Kelly

In my form I have a calculated text box with:

Name.................. PercentageOfFill
Control Source.....
=CircuitDetailsubform!SumOfConductorArea/[AreaOfConduit]*100

In the sub form I have a text box:

Name..................SumNumberOfConductors
Control Source.....=Sum([NumberOfConductors])

I need to have a conditional format set to if 1 conductor 53%; 2 conductors
31%; Over 2 conductors 40%

In the conditional format I tried for condition 1 Expressin Is
=IIf([SumNumberOfConductors]=1,[PercentageOfFill]>0.53*100)
would change color to red. It doesn't seem to accept the IIf statement and
gives me "You may have entered a comma without a preceding value or
identifier"
What am I doing wrong?

Kelly
 
in your conditional formatting you may want

SumNumberofconductors=1 AND PercentageOfFill>0.53

So that box will change color if both of those conditions are true

Then for the full condition you may want

(SumNumberofconductors=1 AND PercentageOfFill>0.53) OR
(SumNumberofconductors=2 AND PercentageOfFill>0.31) OR
(SumNumberofconductors=3 AND PercentageOfFill>0.40)

depending on which form you are taking the numbers from and which box you
want to change color you may need

subformname!numberofconductors or parent!percentageOrFill etc to get
everything pointed right
 
Thanks Chegu that gave me a start in the right direction. I tried what you
suggested but still had problems. I used and it worked.

(CircuitDetailsubform!SumNumberofConductors=1) And
(CircuitDetailsubform!SumOfConductorArea/[AreaOfConduit]*100>53)

I guess since I was putting the conditional format on PercentageOfFill text
box the expression in the control source was getting in the way. Trial and
error is how I am learning thanks again for your reply.

Kelly


Chegu Tom said:
in your conditional formatting you may want

SumNumberofconductors=1 AND PercentageOfFill>0.53

So that box will change color if both of those conditions are true

Then for the full condition you may want

(SumNumberofconductors=1 AND PercentageOfFill>0.53) OR
(SumNumberofconductors=2 AND PercentageOfFill>0.31) OR
(SumNumberofconductors=3 AND PercentageOfFill>0.40)

depending on which form you are taking the numbers from and which box you
want to change color you may need

subformname!numberofconductors or parent!percentageOrFill etc to get
everything pointed right



Kelly said:
In my form I have a calculated text box with:

Name.................. PercentageOfFill
Control Source.....
=CircuitDetailsubform!SumOfConductorArea/[AreaOfConduit]*100

In the sub form I have a text box:

Name..................SumNumberOfConductors
Control Source.....=Sum([NumberOfConductors])

I need to have a conditional format set to if 1 conductor 53%; 2
conductors
31%; Over 2 conductors 40%

In the conditional format I tried for condition 1 Expressin Is
=IIf([SumNumberOfConductors]=1,[PercentageOfFill]>0.53*100)
would change color to red. It doesn't seem to accept the IIf statement and
gives me "You may have entered a comma without a preceding value or
identifier"
What am I doing wrong?

Kelly
 
Back
Top