Question : Format a textbox when a report opens

Hi

Would like to format a textbox when a report opens based on it's value.  If "Closed" then it would change it to Bold and Red.

So far I'm using this control, can something be added to it without going to code.
=IIf([Sum Of Sum Of POAmount]=[Sum Of Sum Of Invoice],"Closed","Open")

Thanks!

Answer : Format a textbox when a report opens

You cannot do this without using code, but it is very simple code.

Assuming your control is in the report Detail section then you will need a little code in the  Detail section's Format event. It goes like so...


1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Const BOLD = 700
Const NORMAL = 400
    If [Your Control Name] = "Closed" Then
        [Your Control Name].ForeColor = vbRed
        [Your Control Name].FontWeight = BOLD
    Else
        [Your Control Name].ForeColor = vbBlack
        [Your Control Name].FontWeight = NORMAL
    End If
End Sub
Random Solutions  
 
programming4us programming4us