Linking Charts

  • Thread starter Thread starter Maureen
  • Start date Start date
M

Maureen

I'm fairly new on Access and so I'm not quite sure how to
use the tables/queries into charts. I know the chart
wizard is limited to only 6 fields, but I need to use more
than that. So, what I did was I used the chart wizard and
selected my 6 fields, then by right-clicking on the chart
properties, I tried changing the Row Source to include all
the other fields that I need. However, the chart doesn't
come out properly. I compared what the chart should look
like on Excel vs Access, and it comes out totally
different. What am I doing wrong? Is there another way
to do this? Please help. Thanks!
 
Some instructions for a using MsGraph with Access.

The Chart Wizard in Access leaves much to be desired,
ie: you're not limited to 6 Series.

Take a blank Form (even if you're making a graph for a Report)
and insert an unbound object frame.
With the form in design mode, Insert/Object (on the menus), select Ms Graph
(*Not* the Chart Wizard)


Click on the detail of your Form (ie: click off the graph)

Open the properties of the Graph object:
Format Tab: Size Mode - Zoom
Column Heads - Yes
Data Tab: Row Source Type - Table/Query
Row Source - Enter the name of your table, CrossTab Query, Select Query or
SQL
Enabled - Yes
Locked - No

View the form then go right back to design view (this will load
the graph datasheet with your data vs the sample data).
Don't worry about what the graph looks like just yet.

Then right click the Graph and select Chart Object ->Open (not Edit)

Make sure the Data/Series is in Rows or Columns - whatever is
appropriate for your data.

Now you have something to work with. Select the graph type
and any formatting you wish.

The Row Source can be a table or query name or a sql statement which
makes it very nice for dynamic data.

Using automation you can dynamically change the graph
to suit your needs.

If you're *really* making a report, now copy the Graph object
from the form to the report.


Download the Graph Sample MDB from MsKb Q186855, Grphsm97.Exe
and convert it to a newer version of Access if req'd.

Study the Graph Help file Graph9.hlp (A97) or Graph9.chm (A2k)
Study the Graph object Methods and Properties in the Access Object Browser

Also get the automation help files appropriate for you
for various help in coding:

Q302460 Office XP Products
Q260410 Office 2000 Products
Q167223 Office 97 Products


In addition, if this is a multi page report, you will need to add the
following code to the OnPrint section of the report where you placed the
graph to make sure Access keeps the data in sync.


Dim oGraph As Object
Me.Graph1.Requery
Set oGraph = Me!Graph1
oGraph.Refresh
oGraph.Object.Application.Update
Set oGraph = Nothing


Steve
 
Back
Top