OpenReport and Subreport problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Blah

    #1

    OpenReport and Subreport problems

    Hello,

    I'm trying to use the where clause in OpenReport to limit the data return
    on the subreport. Is there a way to do it using that method or OpenReport
    only work with the report you're opening?

    Thanks
  • Jim Allensworth

    #2
    Re: OpenReport and Subreport problems

    On Thu, 22 Jul 2004 17:48:15 GMT, Blah <me@nowhere.com > wrote:
    [color=blue]
    >Hello,
    >
    >I'm trying to use the where clause in OpenReport to limit the data return
    >on the subreport. Is there a way to do it using that method or OpenReport
    >only work with the report you're opening?
    >
    >Thanks[/color]

    How the subreport is linked should take care of that. The Where
    condition will work on the main report and the subreport will be
    constrained by the linked fields.

    - Jim

    Comment

    • Blah

      #3
      Re: OpenReport and Subreport problems

      "Jim Allensworth" <jimNOT@datacen tricsolutions.c om> wrote in
      news:40ffffa4.7 74168109@news.w est.earthlink.n et:
      [color=blue]
      > On Thu, 22 Jul 2004 17:48:15 GMT, Blah <me@nowhere.com > wrote:
      >[color=green]
      >>Hello,
      >>
      >>I'm trying to use the where clause in OpenReport to limit the data
      >>return on the subreport. Is there a way to do it using that method or
      >>OpenReport only work with the report you're opening?
      >>
      >>Thanks[/color]
      >
      > How the subreport is linked should take care of that. The Where
      > condition will work on the main report and the subreport will be
      > constrained by the linked fields.
      >
      > - Jim
      >[/color]

      Thanks for the quick reply but that's not what exactly I'm looking for.

      I forgot to say that the records in the SubReport contain a date. I want
      to limit the return by giving it a date range. So like this.


      Main Report: all the contact info of a company

      Sub Report: all the order they have in the month

      I'm not using a form to pass in the parameters but VBA instead.

      When I go open the report by double clicking on it, it return the correct
      information in the report and all the order record in the sub report.

      Thanks

      Comment

      • Jim Allensworth

        #4
        Re: OpenReport and Subreport problems

        On Thu, 22 Jul 2004 18:15:15 GMT, Blah <me@nowhere.com > wrote:
        [color=blue]
        >"Jim Allensworth" <jimNOT@datacen tricsolutions.c om> wrote in
        >news:40ffffa4. 774168109@news. west.earthlink. net:
        >[color=green]
        >> On Thu, 22 Jul 2004 17:48:15 GMT, Blah <me@nowhere.com > wrote:
        >>[color=darkred]
        >>>Hello,
        >>>
        >>>I'm trying to use the where clause in OpenReport to limit the data
        >>>return on the subreport. Is there a way to do it using that method or
        >>>OpenReport only work with the report you're opening?
        >>>
        >>>Thanks[/color]
        >>
        >> How the subreport is linked should take care of that. The Where
        >> condition will work on the main report and the subreport will be
        >> constrained by the linked fields.
        >>
        >> - Jim
        >>[/color]
        >
        >Thanks for the quick reply but that's not what exactly I'm looking for.
        >
        >I forgot to say that the records in the SubReport contain a date. I want
        >to limit the return by giving it a date range. So like this.
        >
        >
        >Main Report: all the contact info of a company
        >
        >Sub Report: all the order they have in the month
        >
        >I'm not using a form to pass in the parameters but VBA instead.
        >
        >When I go open the report by double clicking on it, it return the correct
        >information in the report and all the order record in the sub report.
        >
        >Thanks[/color]

        It sounds to me like you don't need a subreport. Just a Record Source
        query that contains the company and orders joined. Put the company
        info in the header and use the details for ordering info. Then you
        open with DoCmd.OpenRepor t something like...

        DoCmd.OpenRepor t "rptOrders" , , , _
        "OrderDate Between #1/1/04# And #6/1/04#"

        Will that work?

        - Jim

        Comment

        Working...