Dynamic title on a graph/chart?

L

Laurel

I have an embedded graph/chart on a form (in the Propertis, it has Class =
MsGraph.Chart.8). I have parameterized my database everywhere except for
the Chart Title. Is there anyway to get under the covers and cause this to
be populated dynamically? e.g., if it were just the form I would put =
fncName("Principle1").

In general, where can I go to learn about Charts/Graphs?
 
G

Guest

The only way I have been able to do something like this is to put the data I
want in the Chart Title in a temp table in Access and then put in VB (or
other) code into the chart program to read the table and put it in the
heading.
 
L

Laurel

Could you give me a little bit of guidance about how to reference the chart
title in code? I write code for forms and in modules, but I don't know how
to reference the guts of a chart.
 
G

Guest

I am not sure how MS Graph works. When I did this in Excel, I set up an
access table called Exchange with only 1 record in it with the fields I
wanted to share. Here is the code I added to the Excel spreadsheet that was
set up to run as an event when a particular cell in the spreadsheet changed.
When the data changed, excel will update the data fields in the Exchange
table that is to be shared. In Access then you can pick up the data you need
from the table. In your case, you would put the data you needed for the
graph into the Exchange table, and just read it in MS Graph. I am assuming
you can run a VB script in MS Graph that will run when the graph is loaded.
Here is my code:

Dim cnnConn As ADODB.Connection
Set cnnConn = New ADODB.Connection
Dim rst As ADODB.Recordset
With cnnConn
.Provider = "Microsoft.JET.OLEDB.4.0;"
.ConnectionString = "c:\path to data base\databasename.mdb
End With
cnnConn.Open
Set rst = cnnConn.Execute("select * from exchange where recordnumber=1")

Set temp1 = Range("BudgetTotalIncome")
Set temp2 = Range("BudgetTotalExpense")
Set rst = cnnConn.Execute("update exchange set" _
& " BudgetTotalIncome='" & temp1 _
& "', BudgetTotalExpense='" & temp2 _
& "'where recordnumber=1")
Set cnnConn = Nothing
End Sub

Sorry I can't be more specific - I am not that familar with the programs you
are using. I just thought my experience with excel as an embedded Object
might help.
 
M

mcescher

I have an embedded graph/chart on a form (in the Propertis, it has Class =
MsGraph.Chart.8). I have parameterized my database everywhere except for
the Chart Title. Is there anyway to get under the covers and cause this to
be populated dynamically? e.g., if it were just the form I would put =
fncName("Principle1").

In general, where can I go to learn about Charts/Graphs?

objGraph.ChartTitle.Caption = "New Chart Title"

http://support.microsoft.com/kb/186855
The database listed here is for Access 97, but it will get you started
down the right path

HTH,
Chris M.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top