Set row source of a chart using vb

J

Jay Easley

I am trying to set the row source of a chart by pressing a
button on a form and opening the report and then edit the
chart's row source, but I'm having trouble. This is what
I've got so far.

DoCmd.OpenReport "bMP_Report_02_Task_Force_Bar_Chart",
acViewDesign
Reports!bMP_Report_02_Task_Force_Bar_Chart!
Graph2.RecordSource = "blah blah"

Please help!

thanks,
Jay
 
J

Jay Easley

Ok, i got that but I'm trying to refrence a value in a
variable for the name of the column and I'm having some
trouble. here's what i got so far

Reports!bMP_Report_02_Task_Force_Bar_Chart!
Graph2.RowSource = "SELECT Manpower_Query.Location,Format
(Sum([Month_1])/173.2,'0.0') AS [July '04] , Format(Sum
([Month_2])/173.2,'0.0') AS [AUG '03]

Any help would be appreciated.

thanks,
Jay
 
G

Guest

Jay,

Try:

"SELECT Location,Format
(Sum([Month_1])/173.2,'0.0') AS [July '04] , Format(Sum
([Month_2])/173.2,'0.0') AS [AUG '03]
Group By Location;"

Make sure your query runs using the query grid then view the query Sql, copy
and paste into your code.

Steve

Jay Easley said:
Ok, i got that but I'm trying to refrence a value in a
variable for the name of the column and I'm having some
trouble. here's what i got so far

Reports!bMP_Report_02_Task_Force_Bar_Chart!
Graph2.RowSource = "SELECT Manpower_Query.Location,Format
(Sum([Month_1])/173.2,'0.0') AS [July '04] , Format(Sum
([Month_2])/173.2,'0.0') AS [AUG '03]

Any help would be appreciated.

thanks,
Jay
-----Original Message-----
Jay,

It's because it's not a RecordSource... try RowSource

Reports!bMP_Report_02_Task_Force_Bar_Chart!
Graph2.RowSource = "blah blah"


Steve





.
 

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