Display Image Conditionally (3 Viewers)

I would make sure the Lvl# fields are in the report's record source and included in the GroupHeader1 as bound controls. They don't need to be visible. Then, open the report's record source in datasheet view to make sure the Lvl# fields are valued (no nulls). Then, this code in the GroupHeader1_Format event should work. If you want to display the check box, that's fine but not necessary if the Lvl# fields are all valued with True/False Yes/No -1/0.

Code:
Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)

    Me.Lvl1Img.Visible = Me.Lvl1
    Me.Lvl2Img.Visible = Me.Lvl2
    Me.Lvl3Img.Visible = Me.Lvl3

End Sub
 
Lvl# fields are in the report's record source and included in the GroupHeader1 as bound controls
I would put my money that is what is going on. The OP forgot to bind the checkboxes, because that is about the only way you can return a null value. An unbound checkbox on a form or report returns null. In a form if you click it will become true, then false. Only if triple state is selected can you get back to a null state. But before it is clicked it is null even if not triple state. This assumes that what the OP says is correct.
Changing the expression to =me.Lvl1Ck throws RTE 94 Invalid use of Nul
 

Users who are viewing this thread

Back
Top Bottom