Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Posts
    35

    Unanswered: Applying filter to report and subreport

    I have a filter being applied to a report to restrict by date and is being applied to my main report. I have a copy of this report acting as a subreport, with all detail Visible=No and doing counts on this same data. However, when I attempt to pass the filter string to the subreport, I get errors.

    This is my filter-building code:
    strFilter = "([Cases.Date_of_Death] " & strStartDate & " AND [Cases.Date_of_Death] " & strEndDate & ") OR ([Cases.Discharge_Date] " & strStartDate & " AND [Cases.Discharge_Date] " & strEndDate & ")"

    This is the code passing the filter to the main report (which works):
    Reports(strReport).Filter = strFilter
    Reports(strReport).FilterOn = True

    This is my faulty code that is attempting to pass the same filter string to the subreport:
    Reports(strReport).sbrptProcCompDeath.Report!Filte r = strFilter
    Reports(strReport).sbrptProcCompDeath.Report!Filte rOn = True

    Can anyone help?

    Thanks

  2. #2
    Join Date
    Sep 2003
    Posts
    35
    Does anyone have any suggestions? I'm almost certain it's something silly I'm missing.

Posting Permissions

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