PC Review


Reply
Thread Tools Rate Thread

Conditional Format in Report Using VBA

 
 
=?Utf-8?B?Um9iU29s?=
Guest
Posts: n/a
 
      17th Mar 2006
I am trying to format a text box in a report without using the Conditional
Format feature due to the number of values exceeding three. I basically have
a range of 0 - 100%. Using five different forecolors, I want to represent
different ranges. Here is my example:

Select Case Me.Score
Case Is > 0.6
Me.Score.ForeColor = 32768
Case Is < 0.61
Me.Score.ForeColor = 128
Case Is < 0.45
Me.Score.ForeColor = 8404992
Case Is < 0.32
Me.Score.ForeColor = 33023
Case Is < 0.2
Me.Score.ForeColor = 255
End Select

I have even tried an If statement:
If Me.Score > 0.6 Then
Me.Score.ForeColor = 32768
ElseIf Me.Score.Value > 0.44 < 0.61 Then
Me.Score.ForeColor = 128
ElseIf Me.Score.Value > 0.3 < 0.45 Then
Me.Score.ForeColor = 8404992
ElseIf Me.Score.Value > 0.18 < 0.31 Then
Me.Score.ForeColor = 33023
ElseIf Me.Score.Value < 0.19 Then
Me.Score.ForeColor = 255
End If

Any suggestions would be greatly appreciated!
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Um9iU29s?=
Guest
Posts: n/a
 
      17th Mar 2006
I forgot to mention the in the Select Case example, only the first two cases
work. After that the rest of the numbers are not affected.

"RobSol" wrote:

> I am trying to format a text box in a report without using the Conditional
> Format feature due to the number of values exceeding three. I basically have
> a range of 0 - 100%. Using five different forecolors, I want to represent
> different ranges. Here is my example:
>
> Select Case Me.Score
> Case Is > 0.6
> Me.Score.ForeColor = 32768
> Case Is < 0.61
> Me.Score.ForeColor = 128
> Case Is < 0.45
> Me.Score.ForeColor = 8404992
> Case Is < 0.32
> Me.Score.ForeColor = 33023
> Case Is < 0.2
> Me.Score.ForeColor = 255
> End Select
>
> I have even tried an If statement:
> If Me.Score > 0.6 Then
> Me.Score.ForeColor = 32768
> ElseIf Me.Score.Value > 0.44 < 0.61 Then
> Me.Score.ForeColor = 128
> ElseIf Me.Score.Value > 0.3 < 0.45 Then
> Me.Score.ForeColor = 8404992
> ElseIf Me.Score.Value > 0.18 < 0.31 Then
> Me.Score.ForeColor = 33023
> ElseIf Me.Score.Value < 0.19 Then
> Me.Score.ForeColor = 255
> End If
>
> Any suggestions would be greatly appreciated!

 
Reply With Quote
 
Jörg
Guest
Posts: n/a
 
      17th Mar 2006
The rest can´t work,

because if you have a value like 0.25 the second Case works
and if one case works, the rest dosn´t work any more

Other way:

0.25 is lower than 0.61
0.25 is lower than 0.45
0.25 is lower than 0.32

which of these 3 Cases should work now?? which color do you want to have ;-)


you´ve to need the following ranges:

>=0.6

<0.6 AND >= 0.45
<0.45 AND >= 0.32
<0.32 AND >= 0.2
<0.2

then i think it works

Best regards


"RobSol" <(E-Mail Removed)> schrieb im Newsbeitrag
news:65383E58-363B-4880-A01A-(E-Mail Removed)...
> I forgot to mention the in the Select Case example, only the first two

cases
> work. After that the rest of the numbers are not affected.
>
> "RobSol" wrote:
>
> > I am trying to format a text box in a report without using the

Conditional
> > Format feature due to the number of values exceeding three. I basically

have
> > a range of 0 - 100%. Using five different forecolors, I want to

represent
> > different ranges. Here is my example:
> >
> > Select Case Me.Score
> > Case Is > 0.6
> > Me.Score.ForeColor = 32768
> > Case Is < 0.61
> > Me.Score.ForeColor = 128
> > Case Is < 0.45
> > Me.Score.ForeColor = 8404992
> > Case Is < 0.32
> > Me.Score.ForeColor = 33023
> > Case Is < 0.2
> > Me.Score.ForeColor = 255
> > End Select
> >
> > I have even tried an If statement:
> > If Me.Score > 0.6 Then
> > Me.Score.ForeColor = 32768
> > ElseIf Me.Score.Value > 0.44 < 0.61 Then
> > Me.Score.ForeColor = 128
> > ElseIf Me.Score.Value > 0.3 < 0.45 Then
> > Me.Score.ForeColor = 8404992
> > ElseIf Me.Score.Value > 0.18 < 0.31 Then
> > Me.Score.ForeColor = 33023
> > ElseIf Me.Score.Value < 0.19 Then
> > Me.Score.ForeColor = 255
> > End If
> >
> > Any suggestions would be greatly appreciated!



 
Reply With Quote
 
=?Utf-8?B?Um9iU29s?=
Guest
Posts: n/a
 
      17th Mar 2006
I tried using the example provided, however, the first challenge is the "AND"
in you statement does no work in a Select statement. Second, when deleting
the and just using the following:

Select Case Me.Score
Case Is >= 0.6
Me.Score.ForeColor = 32768
Case Is < 0.6 >= 0.45
Me.Score.ForeColor = 128
Case Is < 0.45 >= 0.32
Me.Score.ForeColor = 8404992
Case Is < 0.32 >= 0.2
Me.Score.ForeColor = 33023
Case Is < 0.2
Me.Score.ForeColor = 255
End Select

The first two cases are only working. The rest of values are set to the
second case.

Any other ideas????


"Jörg" wrote:

> The rest can´t work,
>
> because if you have a value like 0.25 the second Case works
> and if one case works, the rest dosn´t work any more
>
> Other way:
>
> 0.25 is lower than 0.61
> 0.25 is lower than 0.45
> 0.25 is lower than 0.32
>
> which of these 3 Cases should work now?? which color do you want to have ;-)
>
>
> you´ve to need the following ranges:
>
> >=0.6

> <0.6 AND >= 0.45
> <0.45 AND >= 0.32
> <0.32 AND >= 0.2
> <0.2
>
> then i think it works
>
> Best regards
>
>
> "RobSol" <(E-Mail Removed)> schrieb im Newsbeitrag
> news:65383E58-363B-4880-A01A-(E-Mail Removed)...
> > I forgot to mention the in the Select Case example, only the first two

> cases
> > work. After that the rest of the numbers are not affected.
> >
> > "RobSol" wrote:
> >
> > > I am trying to format a text box in a report without using the

> Conditional
> > > Format feature due to the number of values exceeding three. I basically

> have
> > > a range of 0 - 100%. Using five different forecolors, I want to

> represent
> > > different ranges. Here is my example:
> > >
> > > Select Case Me.Score
> > > Case Is > 0.6
> > > Me.Score.ForeColor = 32768
> > > Case Is < 0.61
> > > Me.Score.ForeColor = 128
> > > Case Is < 0.45
> > > Me.Score.ForeColor = 8404992
> > > Case Is < 0.32
> > > Me.Score.ForeColor = 33023
> > > Case Is < 0.2
> > > Me.Score.ForeColor = 255
> > > End Select
> > >
> > > I have even tried an If statement:
> > > If Me.Score > 0.6 Then
> > > Me.Score.ForeColor = 32768
> > > ElseIf Me.Score.Value > 0.44 < 0.61 Then
> > > Me.Score.ForeColor = 128
> > > ElseIf Me.Score.Value > 0.3 < 0.45 Then
> > > Me.Score.ForeColor = 8404992
> > > ElseIf Me.Score.Value > 0.18 < 0.31 Then
> > > Me.Score.ForeColor = 33023
> > > ElseIf Me.Score.Value < 0.19 Then
> > > Me.Score.ForeColor = 255
> > > End If
> > >
> > > Any suggestions would be greatly appreciated!

>
>
>

 
Reply With Quote
 
Jörg
Guest
Posts: n/a
 
      17th Mar 2006
Hi Rob,

trying again using this code:
---------------------
Private Sub Detailbereich_Format(Cancel As Integer, FormatCount As Integer)
Select Case Me.Score
Case Is >= 0.6
Me.Score.ForeColor = 32768
Case 0.45 To 0.59999999
Me.Score.ForeColor = 128
Case 0.32 To 0.44999999
Me.Score.ForeColor = 8404992
Case 0.2 To 0.31999999
Me.Score.ForeColor = 33023
Case Is < 0.2
Me.Score.ForeColor = 255
End Select
End Sub
---------------


"RobSol" <(E-Mail Removed)> schrieb im Newsbeitrag
news:94D79DD0-3986-4447-8849-(E-Mail Removed)...
> I tried using the example provided, however, the first challenge is the

"AND"
> in you statement does no work in a Select statement. Second, when deleting
> the and just using the following:
>
> Select Case Me.Score
> Case Is >= 0.6
> Me.Score.ForeColor = 32768
> Case Is < 0.6 >= 0.45
> Me.Score.ForeColor = 128
> Case Is < 0.45 >= 0.32
> Me.Score.ForeColor = 8404992
> Case Is < 0.32 >= 0.2
> Me.Score.ForeColor = 33023
> Case Is < 0.2
> Me.Score.ForeColor = 255
> End Select
>
> The first two cases are only working. The rest of values are set to the
> second case.
>
> Any other ideas????
>
>
> "Jörg" wrote:
>
> > The rest can´t work,
> >
> > because if you have a value like 0.25 the second Case works
> > and if one case works, the rest dosn´t work any more
> >
> > Other way:
> >
> > 0.25 is lower than 0.61
> > 0.25 is lower than 0.45
> > 0.25 is lower than 0.32
> >
> > which of these 3 Cases should work now?? which color do you want to have

;-)
> >
> >
> > you´ve to need the following ranges:
> >
> > >=0.6

> > <0.6 AND >= 0.45
> > <0.45 AND >= 0.32
> > <0.32 AND >= 0.2
> > <0.2
> >
> > then i think it works
> >
> > Best regards
> >
> >
> > "RobSol" <(E-Mail Removed)> schrieb im Newsbeitrag
> > news:65383E58-363B-4880-A01A-(E-Mail Removed)...
> > > I forgot to mention the in the Select Case example, only the first two

> > cases
> > > work. After that the rest of the numbers are not affected.
> > >
> > > "RobSol" wrote:
> > >
> > > > I am trying to format a text box in a report without using the

> > Conditional
> > > > Format feature due to the number of values exceeding three. I

basically
> > have
> > > > a range of 0 - 100%. Using five different forecolors, I want to

> > represent
> > > > different ranges. Here is my example:
> > > >
> > > > Select Case Me.Score
> > > > Case Is > 0.6
> > > > Me.Score.ForeColor = 32768
> > > > Case Is < 0.61
> > > > Me.Score.ForeColor = 128
> > > > Case Is < 0.45
> > > > Me.Score.ForeColor = 8404992
> > > > Case Is < 0.32
> > > > Me.Score.ForeColor = 33023
> > > > Case Is < 0.2
> > > > Me.Score.ForeColor = 255
> > > > End Select
> > > >
> > > > I have even tried an If statement:
> > > > If Me.Score > 0.6 Then
> > > > Me.Score.ForeColor = 32768
> > > > ElseIf Me.Score.Value > 0.44 < 0.61 Then
> > > > Me.Score.ForeColor = 128
> > > > ElseIf Me.Score.Value > 0.3 < 0.45 Then
> > > > Me.Score.ForeColor = 8404992
> > > > ElseIf Me.Score.Value > 0.18 < 0.31 Then
> > > > Me.Score.ForeColor = 33023
> > > > ElseIf Me.Score.Value < 0.19 Then
> > > > Me.Score.ForeColor = 255
> > > > End If
> > > >
> > > > Any suggestions would be greatly appreciated!

> >
> >
> >



 
Reply With Quote
 
Robin
Guest
Posts: n/a
 
      17th Mar 2006
There might be a cleaner solution but I'm sure the following will work. It
steps through each level until it finds something untrue:

Me.Score.ForeColor = 255
If Me.Score.Value > 0.18 Then Me.Score.ForeColor = 33023
If Me.Score.Value > 0.3 Then Me.Score.ForeColor = 8404992
If Me.Score.Value > 0.44 Then Me.Score.ForeColor = 128
If Me.Score > 0.6 Then Me.Score.ForeColor = 32768



"RobSol" <(E-Mail Removed)> wrote in message
news:84A4441F-9682-49A6-8155-(E-Mail Removed)...
>I am trying to format a text box in a report without using the Conditional
> Format feature due to the number of values exceeding three. I basically
> have
> a range of 0 - 100%. Using five different forecolors, I want to represent
> different ranges. Here is my example:
>
> Select Case Me.Score
> Case Is > 0.6
> Me.Score.ForeColor = 32768
> Case Is < 0.61
> Me.Score.ForeColor = 128
> Case Is < 0.45
> Me.Score.ForeColor = 8404992
> Case Is < 0.32
> Me.Score.ForeColor = 33023
> Case Is < 0.2
> Me.Score.ForeColor = 255
> End Select
>
> I have even tried an If statement:
> If Me.Score > 0.6 Then
> Me.Score.ForeColor = 32768
> ElseIf Me.Score.Value > 0.44 < 0.61 Then
> Me.Score.ForeColor = 128
> ElseIf Me.Score.Value > 0.3 < 0.45 Then
> Me.Score.ForeColor = 8404992
> ElseIf Me.Score.Value > 0.18 < 0.31 Then
> Me.Score.ForeColor = 33023
> ElseIf Me.Score.Value < 0.19 Then
> Me.Score.ForeColor = 255
> End If
>
> Any suggestions would be greatly appreciated!



 
Reply With Quote
 
=?Utf-8?B?S2xhdHV1?=
Guest
Posts: n/a
 
      17th Mar 2006
The trick with the select statement is that it stops at the first True value
it finds. If you put them in this order, it should work just fine except if
you hit a value that is from .6 to .609
Case Is < 0.61 will be false
Case Is > 0.6 will also be false

The solution is to change this line:
Case Is > 0.6
To
Case Is >= 0.6
Or
Case Else
The Case Else will get the color for any value .61 or higher

Select Case Me.Score
Case Is < 0.2
Me.Score.ForeColor = 255
Case Is < 0.32
Me.Score.ForeColor = 33023
Case Is < 0.45
Me.Score.ForeColor = 8404992
Case Is < 0.61
Me.Score.ForeColor = 128
Case Is > 0.6
Me.Score.ForeColor = 32768
End Select


"RobSol" wrote:

> I am trying to format a text box in a report without using the Conditional
> Format feature due to the number of values exceeding three. I basically have
> a range of 0 - 100%. Using five different forecolors, I want to represent
> different ranges. Here is my example:
>
> Select Case Me.Score
> Case Is > 0.6
> Me.Score.ForeColor = 32768
> Case Is < 0.61
> Me.Score.ForeColor = 128
> Case Is < 0.45
> Me.Score.ForeColor = 8404992
> Case Is < 0.32
> Me.Score.ForeColor = 33023
> Case Is < 0.2
> Me.Score.ForeColor = 255
> End Select
>
> I have even tried an If statement:
> If Me.Score > 0.6 Then
> Me.Score.ForeColor = 32768
> ElseIf Me.Score.Value > 0.44 < 0.61 Then
> Me.Score.ForeColor = 128
> ElseIf Me.Score.Value > 0.3 < 0.45 Then
> Me.Score.ForeColor = 8404992
> ElseIf Me.Score.Value > 0.18 < 0.31 Then
> Me.Score.ForeColor = 33023
> ElseIf Me.Score.Value < 0.19 Then
> Me.Score.ForeColor = 255
> End If
>
> Any suggestions would be greatly appreciated!

 
Reply With Quote
 
=?Utf-8?B?Um9iU29s?=
Guest
Posts: n/a
 
      17th Mar 2006
Jörg,
It worked!!! Thanks this really helped.

"Jörg" wrote:

> Hi Rob,
>
> trying again using this code:
> ---------------------
> Private Sub Detailbereich_Format(Cancel As Integer, FormatCount As Integer)
> Select Case Me.Score
> Case Is >= 0.6
> Me.Score.ForeColor = 32768
> Case 0.45 To 0.59999999
> Me.Score.ForeColor = 128
> Case 0.32 To 0.44999999
> Me.Score.ForeColor = 8404992
> Case 0.2 To 0.31999999
> Me.Score.ForeColor = 33023
> Case Is < 0.2
> Me.Score.ForeColor = 255
> End Select
> End Sub
> ---------------
>
>
> "RobSol" <(E-Mail Removed)> schrieb im Newsbeitrag
> news:94D79DD0-3986-4447-8849-(E-Mail Removed)...
> > I tried using the example provided, however, the first challenge is the

> "AND"
> > in you statement does no work in a Select statement. Second, when deleting
> > the and just using the following:
> >
> > Select Case Me.Score
> > Case Is >= 0.6
> > Me.Score.ForeColor = 32768
> > Case Is < 0.6 >= 0.45
> > Me.Score.ForeColor = 128
> > Case Is < 0.45 >= 0.32
> > Me.Score.ForeColor = 8404992
> > Case Is < 0.32 >= 0.2
> > Me.Score.ForeColor = 33023
> > Case Is < 0.2
> > Me.Score.ForeColor = 255
> > End Select
> >
> > The first two cases are only working. The rest of values are set to the
> > second case.
> >
> > Any other ideas????
> >
> >
> > "Jörg" wrote:
> >
> > > The rest can´t work,
> > >
> > > because if you have a value like 0.25 the second Case works
> > > and if one case works, the rest dosn´t work any more
> > >
> > > Other way:
> > >
> > > 0.25 is lower than 0.61
> > > 0.25 is lower than 0.45
> > > 0.25 is lower than 0.32
> > >
> > > which of these 3 Cases should work now?? which color do you want to have

> ;-)
> > >
> > >
> > > you´ve to need the following ranges:
> > >
> > > >=0.6
> > > <0.6 AND >= 0.45
> > > <0.45 AND >= 0.32
> > > <0.32 AND >= 0.2
> > > <0.2
> > >
> > > then i think it works
> > >
> > > Best regards
> > >
> > >
> > > "RobSol" <(E-Mail Removed)> schrieb im Newsbeitrag
> > > news:65383E58-363B-4880-A01A-(E-Mail Removed)...
> > > > I forgot to mention the in the Select Case example, only the first two
> > > cases
> > > > work. After that the rest of the numbers are not affected.
> > > >
> > > > "RobSol" wrote:
> > > >
> > > > > I am trying to format a text box in a report without using the
> > > Conditional
> > > > > Format feature due to the number of values exceeding three. I

> basically
> > > have
> > > > > a range of 0 - 100%. Using five different forecolors, I want to
> > > represent
> > > > > different ranges. Here is my example:
> > > > >
> > > > > Select Case Me.Score
> > > > > Case Is > 0.6
> > > > > Me.Score.ForeColor = 32768
> > > > > Case Is < 0.61
> > > > > Me.Score.ForeColor = 128
> > > > > Case Is < 0.45
> > > > > Me.Score.ForeColor = 8404992
> > > > > Case Is < 0.32
> > > > > Me.Score.ForeColor = 33023
> > > > > Case Is < 0.2
> > > > > Me.Score.ForeColor = 255
> > > > > End Select
> > > > >
> > > > > I have even tried an If statement:
> > > > > If Me.Score > 0.6 Then
> > > > > Me.Score.ForeColor = 32768
> > > > > ElseIf Me.Score.Value > 0.44 < 0.61 Then
> > > > > Me.Score.ForeColor = 128
> > > > > ElseIf Me.Score.Value > 0.3 < 0.45 Then
> > > > > Me.Score.ForeColor = 8404992
> > > > > ElseIf Me.Score.Value > 0.18 < 0.31 Then
> > > > > Me.Score.ForeColor = 33023
> > > > > ElseIf Me.Score.Value < 0.19 Then
> > > > > Me.Score.ForeColor = 255
> > > > > End If
> > > > >
> > > > > Any suggestions would be greatly appreciated!
> > >
> > >
> > >

>
>
>

 
Reply With Quote
 
=?Utf-8?B?Um9iU29s?=
Guest
Posts: n/a
 
      17th Mar 2006
Robin,
Yours worked as well. Thanks again.

"Robin" wrote:

> There might be a cleaner solution but I'm sure the following will work. It
> steps through each level until it finds something untrue:
>
> Me.Score.ForeColor = 255
> If Me.Score.Value > 0.18 Then Me.Score.ForeColor = 33023
> If Me.Score.Value > 0.3 Then Me.Score.ForeColor = 8404992
> If Me.Score.Value > 0.44 Then Me.Score.ForeColor = 128
> If Me.Score > 0.6 Then Me.Score.ForeColor = 32768
>
>
>
> "RobSol" <(E-Mail Removed)> wrote in message
> news:84A4441F-9682-49A6-8155-(E-Mail Removed)...
> >I am trying to format a text box in a report without using the Conditional
> > Format feature due to the number of values exceeding three. I basically
> > have
> > a range of 0 - 100%. Using five different forecolors, I want to represent
> > different ranges. Here is my example:
> >
> > Select Case Me.Score
> > Case Is > 0.6
> > Me.Score.ForeColor = 32768
> > Case Is < 0.61
> > Me.Score.ForeColor = 128
> > Case Is < 0.45
> > Me.Score.ForeColor = 8404992
> > Case Is < 0.32
> > Me.Score.ForeColor = 33023
> > Case Is < 0.2
> > Me.Score.ForeColor = 255
> > End Select
> >
> > I have even tried an If statement:
> > If Me.Score > 0.6 Then
> > Me.Score.ForeColor = 32768
> > ElseIf Me.Score.Value > 0.44 < 0.61 Then
> > Me.Score.ForeColor = 128
> > ElseIf Me.Score.Value > 0.3 < 0.45 Then
> > Me.Score.ForeColor = 8404992
> > ElseIf Me.Score.Value > 0.18 < 0.31 Then
> > Me.Score.ForeColor = 33023
> > ElseIf Me.Score.Value < 0.19 Then
> > Me.Score.ForeColor = 255
> > End If
> >
> > Any suggestions would be greatly appreciated!

>
>
>

 
Reply With Quote
 
Jörg
Guest
Posts: n/a
 
      17th Mar 2006
Hey Rob,

no problem...

Best regards...


"RobSol" <(E-Mail Removed)> schrieb im Newsbeitrag
news:B2A18466-DC01-44FF-8DD5-(E-Mail Removed)...
> Jörg,
> It worked!!! Thanks this really helped.
>
> "Jörg" wrote:
>
> > Hi Rob,
> >
> > trying again using this code:
> > ---------------------
> > Private Sub Detailbereich_Format(Cancel As Integer, FormatCount As

Integer)
> > Select Case Me.Score
> > Case Is >= 0.6
> > Me.Score.ForeColor = 32768
> > Case 0.45 To 0.59999999
> > Me.Score.ForeColor = 128
> > Case 0.32 To 0.44999999
> > Me.Score.ForeColor = 8404992
> > Case 0.2 To 0.31999999
> > Me.Score.ForeColor = 33023
> > Case Is < 0.2
> > Me.Score.ForeColor = 255
> > End Select
> > End Sub
> > ---------------
> >
> >
> > "RobSol" <(E-Mail Removed)> schrieb im Newsbeitrag
> > news:94D79DD0-3986-4447-8849-(E-Mail Removed)...
> > > I tried using the example provided, however, the first challenge is

the
> > "AND"
> > > in you statement does no work in a Select statement. Second, when

deleting
> > > the and just using the following:
> > >
> > > Select Case Me.Score
> > > Case Is >= 0.6
> > > Me.Score.ForeColor = 32768
> > > Case Is < 0.6 >= 0.45
> > > Me.Score.ForeColor = 128
> > > Case Is < 0.45 >= 0.32
> > > Me.Score.ForeColor = 8404992
> > > Case Is < 0.32 >= 0.2
> > > Me.Score.ForeColor = 33023
> > > Case Is < 0.2
> > > Me.Score.ForeColor = 255
> > > End Select
> > >
> > > The first two cases are only working. The rest of values are set to

the
> > > second case.
> > >
> > > Any other ideas????
> > >
> > >
> > > "Jörg" wrote:
> > >
> > > > The rest can´t work,
> > > >
> > > > because if you have a value like 0.25 the second Case works
> > > > and if one case works, the rest dosn´t work any more
> > > >
> > > > Other way:
> > > >
> > > > 0.25 is lower than 0.61
> > > > 0.25 is lower than 0.45
> > > > 0.25 is lower than 0.32
> > > >
> > > > which of these 3 Cases should work now?? which color do you want to

have
> > ;-)
> > > >
> > > >
> > > > you´ve to need the following ranges:
> > > >
> > > > >=0.6
> > > > <0.6 AND >= 0.45
> > > > <0.45 AND >= 0.32
> > > > <0.32 AND >= 0.2
> > > > <0.2
> > > >
> > > > then i think it works
> > > >
> > > > Best regards
> > > >
> > > >
> > > > "RobSol" <(E-Mail Removed)> schrieb im Newsbeitrag
> > > > news:65383E58-363B-4880-A01A-(E-Mail Removed)...
> > > > > I forgot to mention the in the Select Case example, only the first

two
> > > > cases
> > > > > work. After that the rest of the numbers are not affected.
> > > > >
> > > > > "RobSol" wrote:
> > > > >
> > > > > > I am trying to format a text box in a report without using the
> > > > Conditional
> > > > > > Format feature due to the number of values exceeding three. I

> > basically
> > > > have
> > > > > > a range of 0 - 100%. Using five different forecolors, I want to
> > > > represent
> > > > > > different ranges. Here is my example:
> > > > > >
> > > > > > Select Case Me.Score
> > > > > > Case Is > 0.6
> > > > > > Me.Score.ForeColor = 32768
> > > > > > Case Is < 0.61
> > > > > > Me.Score.ForeColor = 128
> > > > > > Case Is < 0.45
> > > > > > Me.Score.ForeColor = 8404992
> > > > > > Case Is < 0.32
> > > > > > Me.Score.ForeColor = 33023
> > > > > > Case Is < 0.2
> > > > > > Me.Score.ForeColor = 255
> > > > > > End Select
> > > > > >
> > > > > > I have even tried an If statement:
> > > > > > If Me.Score > 0.6 Then
> > > > > > Me.Score.ForeColor = 32768
> > > > > > ElseIf Me.Score.Value > 0.44 < 0.61 Then
> > > > > > Me.Score.ForeColor = 128
> > > > > > ElseIf Me.Score.Value > 0.3 < 0.45 Then
> > > > > > Me.Score.ForeColor = 8404992
> > > > > > ElseIf Me.Score.Value > 0.18 < 0.31 Then
> > > > > > Me.Score.ForeColor = 33023
> > > > > > ElseIf Me.Score.Value < 0.19 Then
> > > > > > Me.Score.ForeColor = 255
> > > > > > End If
> > > > > >
> > > > > > Any suggestions would be greatly appreciated!
> > > >
> > > >
> > > >

> >
> >
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional format in a report CGo Microsoft Access Reports 1 28th Jul 2009 04:26 PM
Conditional Format for Report =?Utf-8?B?Q2FybGFJbkpheA==?= Microsoft Access Reports 10 25th Sep 2007 12:02 AM
Conditional format in a report Martin Hopkins Microsoft Access Reports 1 29th May 2006 02:31 AM
Re: Conditional Format in a Report Marshall Barton Microsoft Access Reports 0 5th Dec 2005 05:39 AM
Conditional format in a report Conditional format Microsoft Access Reports 1 20th Feb 2004 02:19 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:19 AM.