Display image in MS Access Report based on value of action item field for each record

chaticathe used Ask the Experts™
I want to display the image of a star for each action item record that has a value of 0 in a report. The star should display in place of the 0. The records are contained in a subform on the report.  This is the code that I have but it is not working. It currently displays a star for each record.

The code is located in the Detail Format on the main form.  

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me!Mitigation_Events_Subreport.Form!Action_No = 0 Then
    Me!Mitigation_Events_Subreport.Form!Star.Visible = True
    Me!Mitigation_Events_Subreport.Form!Action_No.Visible = False
    Me!Mitigation_Events_Subreport.Form!Star.Visible = False
    Me!Mitigation_Events_Subreport.Form!Action_No.Visible = True
End If
End Sub
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012
That code has to go in the sub report, OnFormat event of the detail


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial