use "For Next" to Check 10 value in report; if they are <0.5 bold

  • Thread starter Thread starter Pascal.H
  • Start date Start date
P

Pascal.H

data all between 0% to 100%(string) , like 10%, 20%, 100%...
filed name in report like: pctvc01 pctvc02 pct03 ..pctvc10.

in the report i have to do 10 time to chkek like:
(how can I change For Next statement to do them)
'===
If Val(Me.pctvc01) / 100 < 0.5 Then
Me.pctvc01.FontWeight = 900
Else
Me.pctvc01.FontWeight = 400
End If
'===
If Val(Me.pctvc02) / 100 < 0.5 Then
Me.pctvc02.FontWeight = 900
Else
Me.pctvc02.FontWeight = 400
End If
.....
 
As explained in another thread:
Dim strField As String
For i = 1 to 10
strField = "pctvb" & Format(i, "00")
Me(strField).FontWeight = ...

But it's not a relational design.
 
Back
Top