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

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
.....
 
A

Allen Browne

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top