Solved

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

Posted on 2006-07-17
8
1,242 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

 

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

Independent Software Vendors: 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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

626 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