Chart source setting with VBA

N

nathan_savidge

Hi,

I currently have a chart grpQuickLook on a form in Access. I am setting the
row source of this based on the selection made by the user. If they select
to add data by an individual, it will show the individuals chart and if they
select to add data by a team, then it will show the team data.

This is the code i have used

..grpQuickLook.RowSource = "SELECT tbl_Metrics_Data_Entry.dt_Date_Entered,
Sum(tbl_Metrics_Data_Entry.intVolume) AS Volumes, " & _

"Sum(tbl_Metrics_Data_Entry.intTime) AS Timings FROM tbl_Metrics_Data_Entry "
& _
"WHERE
(((tbl_Metrics_Data_Entry.Team_ID) = " & .cboTeams & ")) " & _
"GROUP BY
tbl_Metrics_Data_Entry.dt_Date_Entered;"
..grpQuickLook.HasTitle = True
..grpQuickLook.charttitle.Caption = .cboTeams.Column(1) & " Summary Chart"


The code errors on the hastitle and the caption lines. I have read
somewhere that i may need to add series' back in to the chart, but am unsure
of this. The error message says can not set the property.

TIA

Nathan.
 
G

george 16-17

Nathan,

I am not an expert, but try:

With Me.grpQuickLook.Object.Application.Chart
Me.grpQuickLook.HasTitle = True
Me.grpQuickLook.chartTitle.Text = Me.cboTeams.Column(1) & " Summary Chart"
End with

Let me know if this helps.

george
 
G

george 16-17

Oops...hit the post button too quick...a little shorter code:

With Me.grpQuickLook.Object.Application.Chart
..HasTitle = True
..ChartTitle.Text = Me.cboTeams.Column(1) & " Summary Chart"
End with
 

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