Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2005
    Posts
    183

    Unanswered: filter on subreport with docmd.openreport

    Usually I would be using something like this to open a report code-wise

    Code:
    filter = "ID = " & Str(box_teater.Value)
    DoCmd.OpenReport "md_rpt_lilleret_faktura", acViewPreview, , filter
    The filter string however is restricted to the main report.

    How can I increase the scope of the filter to the subreport?

    I only want the reports on ID=X, with subreports only covering ID's Y.

    Would I have to make the above openreport, and after that do a direct reference on filter and requery?

    Thanks in advance,

    Trin
    IT squid: networks, servers, firewalls, routers and I dabble a little with SQL-server and Access as well....

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Interesting.

    Ideally, the sub-reports are displaying information related to the data on the main report. Can you setup a "Parent-Child" relationship?

    A roundabout method would be to apply the filter to the subreports before opening the main report (open them in design view hidden, set the Filter poperty, set FilterOn to true, save and close).

    good luck,
    tc

Posting Permissions

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