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

    Chart from subform

    Hello, I have a subform where the user can use combo boxes and text boxes to field filters in my subform, and I am looking for a way to make a chart from the filtered subform data.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Use the same filter criteria in the chart RowSource.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    zplatt98 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2019
    Posts
    10
    Hi June7, is this the correct way to set my charts record source equal to the date filtering? Me.dataChart.RowSource = "[FormDate] Between #" & Format(Me.startDate, "mm\/dd\/yyyy") & " # And # " & Format(Me.endDate, "mm\/dd\/yyyy") & "#" . I receive an error saying invalid use of brackets for the field of "[FormDate]" .

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Chart RowSource must be a complete SQL statement: SELECT …
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    zplatt98 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2019
    Posts
    10
    "SELECT [FormDate] FROM [tblResin] WHERE [FormDate] Between #" & Format(Me.startDate, "mm\/dd\/yyyy") & " # And # " & Format(Me.endDate, "mm\/dd\/yyyy") & "#" would this be the correct syntax?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    I say give it a try. Using VBA to set RowSource should work in form but probably won't with a report.

    Instead of using VBA, just build that SQL directly in RowSource. That's what I do.
    Example from my db: SELECT M, D, FD, ZD, ZDM FROM GraphProctor WHERE LabNum=[tbxLabNum];

    Are you building a pie chart?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    zplatt98 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2019
    Posts
    10
    I was building a line graph, and it worked perfectly. Thank you!

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

Similar Threads

  1. Limit chart to date range , Chart isnt updating .
    By fluffyvampirekitten in forum Access
    Replies: 5
    Last Post: 06-30-2015, 12:27 AM
  2. Replies: 1
    Last Post: 07-18-2014, 04:11 AM
  3. Report with embedded subform pivot chart
    By tmcrouse in forum Access
    Replies: 19
    Last Post: 06-13-2014, 08:06 AM
  4. Replies: 9
    Last Post: 01-29-2013, 06:44 PM
  5. Replies: 2
    Last Post: 07-12-2010, 05:39 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