Results 1 to 4 of 4
  1. #1
    zplatt98 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2019
    Posts
    10

    Changing RowSource of chart on a report from a form

    Currently, I am trying to adjust the RowSource of a chart when a user clicks a print chart button to the dates the user has selected from a form. The chart is called "particleChart" and the report is named "particleDistributionChartReport" and I am trying to open it using this code:
    DoCmd.OpenReport "particleDistributionChartReport", acViewPreview, , Reports![particleDistributionChartReport].Controls!particleChart.RowSource = "SELECT [Pan],[30Mesh], [35Mesh], [40Mesh], [60Mesh], [80Mesh], [100Mesh], [FormDate] FROM [tblResin] WHERE [FormDate] Between #" & Format(Me.startDate, "mm\/dd\/yyyy") & " # And # " & Format(Me.endDate, "mm\/dd\/yyyy") & "#"

    Any tips on the syntax would be awesome, thank you!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    That argument is to limit the record source of the report. It would look more like:

    http://www.baldyweb.com/wherecondition.htm

    In you case, why not have the query underlying the chart get criteria from the form where the user enters them?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    zplatt98 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2019
    Posts
    10
    How would I go about solving it that way?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    In the criteria of the query you'd have

    Between Forms!FormName.StartDate And Forms!FormName.EndDate

    replacing FormName with the actual form name.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 08-21-2018, 05:23 PM
  2. Changing RowSource when a form opens?
    By TotalNovice in forum Forms
    Replies: 3
    Last Post: 09-19-2017, 06:43 PM
  3. Changing text border in Chart / Design
    By Jaap in forum Access
    Replies: 2
    Last Post: 04-21-2017, 06:13 AM
  4. Replies: 12
    Last Post: 11-25-2016, 01:49 AM
  5. Replies: 2
    Last Post: 02-03-2016, 09:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums