Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Unanswered: Filter data send to Chart

    I have a report which is run via DoCmd with a where condition

    However, the graph (in the report footer) based of a
    SQL statment for the same query always includes ALL of
    the data.

    How can I pass my where clause to the SQL statement that
    is the rowsource of the chart?

  2. #2
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Instead of passing the DoCmd with the WHERE clause, pass the clause as OpenArgs. In the report's Open event, capture the OpenArgs (Me.OpenArgs) and use it to set a filter for the report; set filter on. You can then use that same string to set a filter for the SQL in the footer, if you set the SQL up in VBA (such as in the report's Footer section).

    Hope this helps,

    Sam

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Thank you for your advise, I'll give it a try.
    I'm not sure when I'll set report filter on, it should affect the SQl of the chart
    i.e the chart's RowSource

    Thanks again

  4. #4
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Quote Originally Posted by hammbakka
    Thank you for your advise, I'll give it a try.
    I'm not sure when I'll set report filter on, it should affect the SQl of the chart
    i.e the chart's RowSource

    Thanks again
    If you put that code in the report's Open event, it will do just that.

    Sam

Posting Permissions

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