Results 1 to 5 of 5
  1. #1
    kdbailey is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Aug 2012
    Posts
    228

    Access 2007 Chart - Series Titles


    I'm trying to figure out through VBA how to identify the series title of a series on a chart on my form. If I find the right title, I'm trying to change the chart type. Apparently access defaults to alphabetically organizing the table field in which the chart is referring to as the series.

    I cannot find the property in which the title of the seriescollection lies. Obviously there are other ways around this, however I'd like to know if there is an easy way to find it.

    Code:
    srstitle = "thisone"
    For Each srs In screen.activeform.graph1.seriescollection
       If srs.name = srstitle Then
           'Other code
       End If
    Next srs
    Anybody know the correct syntax?

  2. #2
    AccessPower's Avatar
    AccessPower is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2016
    Posts
    165
    Note sure, but maybe this will work:

    Dim srsTitle = "thisone"
    For i = 1 to screen.activeform.graph1.SeriesCollection.Count
    If screen.activeform.graph1.SeriesCollection(i).name = srsTitle Then
    'Code
    End if
    Next

    This is untested.

  3. #3
    kdbailey is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Aug 2012
    Posts
    228
    Unfortunately, that's basically the same code.

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936

  5. #5
    kdbailey is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Aug 2012
    Posts
    228
    The sub provided gives me properties of the chart, however it does not supply properties of the specific series within the chart. I tried applying the same logic to the chart.seriescollection(x).properties and it gave me an error.

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

Similar Threads

  1. Replies: 3
    Last Post: 08-18-2016, 06:56 AM
  2. Chart with Multiple Series from Query
    By crimedog in forum Access
    Replies: 1
    Last Post: 09-01-2015, 12:38 PM
  3. Pivot chart legend series name won't change
    By BCJourney in forum Forms
    Replies: 5
    Last Post: 12-05-2013, 07:48 AM
  4. Replies: 4
    Last Post: 07-29-2012, 04:38 PM
  5. Replies: 4
    Last Post: 03-04-2012, 08:59 PM

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