Solved

Microsoft Graph: Can't access seriesCollection after changing the rowSource

Posted on 2006-07-17
8
1,232 Views
Last Modified: 2008-01-09
'Hi, I am using VBA to manipulate Graph 9.0 on an Access form.  I use form buttons to change chartType, rowSource, etc. programatically and format various Graph attributes like colors, fonts, etc.  However, there seems to be a lag between the time the rowSource takes affect and when certain attributes become available to my program, such as the SeriesCollection.  As an example, when I change from a single series graph to a multiple series graph, I can still only access the 1st series:

         cht.RowSource = "qryMultipleSeriesData"

        cht.ApplyDataLabels Type:=xlDataLabelsShowValue, LegendKey:=False

          For x = 1 To SeriesCollection.Count
               With cht.SeriesCollection(x).DataLabels.font
                    .Name = "Arial"
                    .FontStyle = "Regular"
                    .Size = 8
                 End With
            Next x

Even if the Graph has 10 series, it still is registering 1 for the series count from the previously loaded graph.  If I choose again the graph with 1 series, the series count is 10 from the previously displayed graph.

If I load the same graph for a second time in a row, it then gets the appropriate number of series.

So, there seems to be some kind of timing issue when the RowSource is changed.

A couple other considerations: 1) The form with the graph is in a sub-form.  2) If I put a breakpoint between the RowSource command and looping though the SeriesCollection I don't get the problem, 3) it's a pretty big Access app.

Thanks!!!
0
Comment
Question by:neilanjk
  • 5
  • 3
8 Comments
 
LVL 38

Accepted Solution

by:
puppydogbuddy earned 500 total points
ID: 17128053
See this link for some tips/code for changing the row source for a graph object.

                 http://www.groupacg.com/ATip.htm#MSG
Hope this helps.
0
 

Author Comment

by:neilanjk
ID: 17132327
Hey....a useful article.  I have tried several of the ideas mentioned, but so far, nothing has solved the problem.  I'll keep trying.
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17133483
Here we go! This link should provide you with the info you need.

             http://support.microsoft.com/?kbid=209993
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:neilanjk
ID: 17140549
Hi. thanks for the link.  This is useful information and I have tried some of the ideas mentioned, but no luck as of yet.  I'll keep trying....J
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17141262
Educated guess...your problem is somehow related to chart being placed in subform.

Things to try:
1. Requery the subform, not the subform control [syntax:yourSubformName.requery] in the afterUpdate of the subform (not the subform control)
2. make sure you have placed any existing refresh/requery commands outside of any conditional loops (loops that you may or may not enter).
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17141860
Another thing to try for diagnostics only (not a solution):

Try changing the default refresh rate.  May support the assertion that the chart is not being refreshed properly (code in wrong event, etc).

To change the refresh rate go to Tools > Options > Advanced and change the "Refresh Interval (sec)" value to just 1 or 2 seconds.

See if your chart response is any better.
0
 

Author Comment

by:neilanjk
ID: 17143084
Thanks for your latest msgs.....I did an experiment using the 1st link you sent me where you programatically populate the datasheet associated with the graph from a recordset.  So far that seems to be working.  I feel that if you leave it up to the graph to run the associated query, the query takes more time to execute than the availabilty of the graph attribures, such as the SeriesCollection.  You would think that Microsoft would have accounted for this situation?  I am going to accept your first response.  Thanks for the help..Jeff
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 17143581
Jeff,
Glad I could help.

PDB
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question