Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2003
    Posts
    9

    Red face Unanswered: Report header based on WHERE criteria of query

    HELP!! I would like to have my report header based on the "WHERE" criteria of query.
    For eg. I pull records based on date criteria in a query, by providing BETWEEN #1/1/02# and #12/31/02#. I want the dates to be automatically included in my report header. I don't want them based on textbox pop-up option. I would like the dates to change automatically in report everytime I change them manually in my query. I would appreciate if someone can let me know of options that are available.
    Thanks

  2. #2
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    I haven't done this in a while, I know it works in Access97, but I haven't
    tried it in any of the higher versions.

    Create 2 text boxes in your header: txtDate1 & txtDate2
    We'll call the date field passed in by your query dtmQryDate, (this is the field you've applied the "Between..." statement to).

    In the control source for txtDate1, put "=Min([dtmQryDate])"
    In txtDate2, put "=Max([dtmQryDate])"
    Inspiration Through Fermentation

  3. #3
    Join Date
    Aug 2003
    Posts
    9
    Though it works, it doesn't take the exact values that is provided in the WHERE criteria. It takes the min and max values from within the range.
    NOTE: I'm using ACCESS 2000.

  4. #4
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    I'm sorry. I should have thought of that. I know of seen, and even used this, somewhere. Maybe it will come to me later.
    Inspiration Through Fermentation

  5. #5
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Here's another approach...

    Make your query a parameter query, using
    "Between [Start Date] and [End Date]"

    Change the controlsource in txtDate1, (see below), to
    =Reports![YourReportName]![Start Date]
    and txtDate2 to
    =Reports![YourReportName]![End Date]
    Inspiration Through Fermentation

  6. #6
    Join Date
    Aug 2003
    Posts
    9
    This would bring in the pop-up box which would ask my input for the start and end date, which is not what I want. I want the report to automatically take the value as I enter it manually into the query.
    The reason for doing the manual task is to keep track of the dates I ran the query for previously.

Posting Permissions

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