MSGraph RowSource?

A

AlCamp

I'm using Access97 with MSGraph 2000 to develop a report with a graph.

Using the OnOpen event of the report, I'd like to change the SQL statement
for
the RowSource of the Graph, according to user entered values on a dialog
form that calls the report.

example...

If Forms!frmInspectionReportsDialog!AverageOrSum2 = 1 Then
Me.DefectsGraph.RowSource = "SELECT tblDefectTypes.DefectID.... etc etc."

I get "You entered an expression that has an invalid reference to the
property RowSource"

Arrgghh! There's no way to manipulate the RowSource of a graph?
Say it ain't so...

Thanks for any help...
Al Camp
 
D

Duane Hookom

I would either embed the conditions in the row source query or modify the
sql of the saved query that serves as the Row Source of the graph.
 
A

AlCamp

Duane,
Ahhh... I see. I think you're saying that it's not possible to change
the RowSource of a graph at run time, but I can always have the graph call
the same saved query... and I'll alter the SQL for that saved query on the
fly.
That's a good work around... thanks!
And, I can use all the SQL statements I've already developed for the
different charts... Whew!
Al Camp
 
A

AlCamp

Duane,
What would I use to modify the SQL statement of the saved RowSource
query? I checked out the properties of Queries, and can't seem to find
anything that would allow me to change the SQL on the fly.
Could I do that from the OnOpen of the report?
Appreciate any help..
Thanks,
Al Camp
 
D

Duane Hookom

Prior to opening the report, use code like
Dim strSQL as String
strSQL = "SELECT...FROM...WHERE..."
Currentdb.QueryDefs("qselForGraph").SQL = strSQL
 
A

AlCamp

Duane... once again... thanks!
That will work just fine, and I'll place the code on the "calling" dialog
form.
Thanks a lot...
Al Camp
 

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