• ‘Reverse’ Filter (2003 All Updates)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » ‘Reverse’ Filter (2003 All Updates)

    Author
    Topic
    #443034

    I have a report with Sub report. I’d like the report page to only appear if there is any associated datain the sub report
    Any help appreciated
    Steve

    Viewing 0 reply threads
    Author
    Replies
    • #1067847

      I’m not entirely sure what your setup is, but perhaps you could use code like this:

      Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
      Cancel = Not Me.[SubReportName].Report.HasData
      End Sub

      Replace SubReportName with the name of the subreport as a control on the main report. This is not necessarily the same as the name of the subreport in the database window.

      • #1067892

        Hans – thanks yet again
        Exactly where should this go – Tried the on Open on main form but got End Sub error, Tried on No data in sub form and its in a loop
        Steve

        • #1067897

          Because the code Hans gave you was Private Sub Detail_Format( etc..)

          it goes in the Format event of the Detail section of the Main Report.

    Viewing 0 reply threads
    Reply To: ‘Reverse’ Filter (2003 All Updates)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: