Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Naming a chaart Title in Access

Status
Not open for further replies.

mrdod

Technical User
Jun 12, 2006
103
US
I am using the following code to change the title on a chart that is embedded on a form, the charts name is chrtissues. Here is the code I'm using.

Private Sub Form_Open(Cancel As Integer)
Me.chrtissues.charttitle.title = Form_frmmakereport.cmbarea.Value
End Sub

I am getting an "Object does not support this property or method" alarm.
This is weird because the code worked before and now it does not. Any ideas?
 
Try the Load event instead of the Open.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I tried this:
Private Sub Form_Load()
Me.chrt.charttitle = Form_frmmakereport.cmbarea.Value
End Sub

Still getting the "Object does not support this property or method" alarm.

Ugh
 
How are ya mrdod . . .

Code:
[blue]   Me![purple][b][i]GraphName[/i][/b][/purple].ChartTitle.Text = "[purple][b][i]TitleText[/i][/b][/purple]"[/blue]
Note: [purple]GraphName[/purple] is the [blue]Name property[/blue] of the chart.


Calvin.gif
See Ya! . . . . . .
 
Howdy. Yah I named the chart chrt in properties. I did some more research and came up with something a bit different but it works. I created two buttons on the form, a Print button and a Close button. On the Print button I assigned the following code:
Private Sub cmdprint_Click()

Set myGrafObj = Me![chrt].Object.Application.Chart
With myGrafObj
.HasTitle = Not .HasTitle
If .HasTitle Then
.ChartTitle.Text = CStr(Me!tbchartname)
End If
End With
DoCmd.RunMacro "macroprint"

End Sub

Then with the close button I assigned the following code
Private Sub cmdclose_Click()

Set myGrafObj = Me![chrt].Object.Application.Chart
With myGrafObj
If .HasTitle Then
.HasTitle = Not .HasTitle
End If
End With
DoCmd.Close acForm, "frmmakechart"
DoCmd.Close

End Sub

Not sure if this is the best way to go about doing this but it does work so I'm pretty happy.
 
I'm pretty new and was wondering is there a difference between Me!chrt.ChartTitle and Me.crt.ChartTitle? I was under the impression they were equivalent????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top