• multiple openreports (2000)

    Author
    Topic
    #383968

    I need to run one report a number of times.
    The number of times depends on how many entries have been selected in a listbox.
    The code below shows the logic, but when I run it I am only able to see one report.
    Closing the report then doesn’t show the other reports which should have been run.

    I know that the problem is connected with the same report being used in the docmd.openreport command but don’t know how to get round it.

    I don’t NEED to really view each report – sending it direct to print would be best for me.

    Any pointers as to how I can print rather than Preview? I guess this would get round the problem immediately – or not!!

    Code is as follows:

    For intCurrentRow = 0 To ctlSource.ListCount – 1
    strwhere = “Factory = ‘” & Forms!choices!inputfactory & “‘ and date = #” & Forms!choices!inputdate & “# and ”
    If ctlSource.Selected(intCurrentRow) Then
    strwhere = strwhere & “Line = ‘” & ctlSource.Column(0, intCurrentRow) & “‘”
    stDocName = “myreport”
    DoCmd.OpenReport stDocName, acViewPreview, , strwhere
    End If
    Next intCurrentRow

    John

    Viewing 1 reply thread
    Author
    Replies
    • #656891

      Hi

      To prevent the preview of the report change the open report command to:

      DoCmd.OpenReport stDocName, acViewNormal,,strwhere

      Regards
      WTH

    • #657020

      While it is possible to open multiple instances of a report, it requires some rather advanced coding and is more confusing then helpful to a user. Follow the suggestion to open the report in normal view instead, which will send it straight to the print spooler.

      • #657065

        I just didn’t appreciate that the normal view sent direct to the printer – not sure what else i expected it to do, but i’ve only just moved into using VBA instead of macros – getting there slowly

    Viewing 1 reply thread
    Reply To: multiple openreports (2000)

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

    Your information: