Single date query for all main report & subreport RRS feed

  • Question

  • Hi All

    I have a report.
    It has three to four sub-reports
    On each sub-report, the details are all hidden.
    I only make use of their sums.
    How can I query the main reports using the date field so that it will also influence all
    the other sub-reports using that same data since all the sub reports have date field as well.

    Tuesday, November 1, 2016 10:47 AM

All replies

  • Maybe try adding the date field in the Link Master/Child Fields as well.

    Just a thought...

    Tuesday, November 1, 2016 1:18 PM
  • If you are restricting the parent report on a specific date value then do as theDBguy suggests and include the date columns in the LinkMasterFields and LinkChildFields properties of each subreport control.  You can link on multiple columns by separating the column names with a semi-colon in each property.

    If, on the other hand, you are restricting the parent report on a date range then do so by referencing unbound controls in a single dialogue form as parameters in the RecordSource queries of the parent report and each of the subreports.  The dialogue from must remain open when the report is opened of course, but can be closed in the parent report's Close event procedure if you wish to close it automatically.  Note also that it is desirable to declare such parameters as DATETIME in the queries to avoid any risk of their values being inadvertently misinterpreted as arithmetical expressions rather than dates.

    Ken Sheridan, Stafford, England

    • Edited by Ken Sheridan Wednesday, November 2, 2016 12:13 AM Typo corrected.
    Wednesday, November 2, 2016 12:13 AM