• Opening multiple copies of the same report in the same window

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Opening multiple copies of the same report in the same window

    Author
    Topic
    #485319

    I need to show similar copies of the same report, varying only the name of the customer. I found a piece of code in Access 2010 VBA Programming Inside/Out, as follows. It does the job, but I donยดt follow one line of the code. Can you help?

    Code as follows:
    Option Compare Database
    Option Explicit
    Dim colReports As New Collection
    Private Sub Customer_Name_DblClick(Cancel As Integer)
    Dim rpt As Report_rptCustomerDetails
    Set rpt = New Report_rptCustomerDetails
    rpt.Filter = “[Customer Number] = ” & Me.Customer_Number
    rpt.FilterOn = True
    colReports.Add rpt, CStr(CLng(Rnd * (2 ^ 31)))
    rpt.Visible = True
    End Sub

    What if the last paramater on line nine doing?

    Viewing 0 reply threads
    Author
    Replies
    • #1348946

      CStr(CLng(Rnd * (2 ^ 31))) is generating a random, and hopefully unique, number which is used as the Key value to the particular instance of the specific report object that you are creating in the collection of reports.

    Viewing 0 reply threads
    Reply To: Opening multiple copies of the same report in the same window

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

    Your information: