Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Warwick, Warwickshire, England
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    multiple openreports (2000)

    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

  2. #2
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: multiple openreports (2000)

    Hi

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

    DoCmd.OpenReport stDocName, acViewNormal,,strwhere

    Regards
    WTH

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: multiple openreports (2000)

    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.
    Charlotte

  4. #4
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Warwick, Warwickshire, England
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: multiple openreports (2000)

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •