How to Retrieve Active Report from a Subreport ?

Posted by: ngchintamani on 4 August 2017, 3:06 pm EST

  • Posted 4 August 2017, 3:06 pm EST

    Hi, I have a main report containing a subreport. Both are working well. Now I want to get back the subreport structure or object in a active report. Further I want to show the Subreport on a seperate form which I can do.

    Here I am not able to get only the subreport in a active report. I have tried to insert the following line

    Set arSub = arMain.Sections("Detail").Controls("SubReport1").object

    but Error No 2014: Subreport Object ReportName property is invalid or subreport not set.

    Please Help Me.
  • Replied 4 August 2017, 3:06 pm EST


    It seems that report object is allready disposed.

    e.g. the following code works fine:

    Private Sub ActiveReport_ReportStart()

        Me.SubReport1 = New MySubreport

    End Sub

    Private Sub Detail_Format()

        Dim ar As ActiveReport
        Set ar = SubReport1.object
        Set SubReport2 = ar

    End Sub


    Sergey Romanov.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels