Solved

pivot chart title needs to read from form?

Posted on 2009-04-08
7
227 Views
Last Modified: 2013-11-28
is there a way to make my form and/or report chart title read from a form?
im making a chart to see complete and open jobs by mechanic section and the chart is fine but i need to add a title.  and the title needs to be the vehicle being worked on.  which on my reports form i have a txtbox that has vehicles in it.  so can i get the chart title to read that txtbox?
0
Comment
Question by:sumhungl0
  • 4
  • 3
7 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 24097056
I think you would do...

me!ChartName.charttitle.text = me.!textboxname
0
 

Author Comment

by:sumhungl0
ID: 24097088
where do i put that?
gonna look to see if i can find the chart name also, i dont know the names, it was all drag and drop really.
0
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 500 total points
ID: 24097392
Well i don't think it works anyway- reading Help more closely it appears to say contradictory things - see my ****
I've tried to use it and can't get it to work.
_________________________
HELP Entry....
ChartTitle Property
See AlsoApplies ToExampleSpecificsReturns a ChartTitle object that represents the title of the specified chart. ***Read-only.****

Example
This example ***sets*** the text for the title of the chart.

With myChart
    .HasTitle = True
    .ChartTitle.Text = "First Quarter Sales"
End With
_______________________________________________      

I've also realised that you refer to Pivot Charts- so I don't think this will apply anyway.
But I'm not clear what you mean by 'drag and drop' here.
A PivotChart is a form in Access.  Are you using some non-Access control to do this?
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:sumhungl0
ID: 24097449
no its not non-access.  this is the first time ive messed with any type of chart stuff.  so i did the pivot chart in access, and it has me drag and drop fields to drop boxes on the pivot chart area.  so thats where i came to the fact that i need the title to change depending on which vehicle is being charted.
0
 

Author Comment

by:sumhungl0
ID: 24098177
its cool, i think i have to put in the title on the form above the chart area.  or on the report above the chart.
0
 

Author Closing Comment

by:sumhungl0
ID: 31568017
thanks anyway
0
 
LVL 77

Expert Comment

by:peter57r
ID: 24098333
Gee what a pain this is...

I'm using A2003.
This code sets the axis titles in a Pivot Chart in A2003.

Private Sub Form_Load()

Dim oChart As ChChart
Set oChart = Forms(Me.Name).ChartSpace.Charts(0)

oChart.Axes(0).HasTitle = True
oChart.Axes(0).Title.Caption = " Horiz Axis"
oChart.Axes(1).HasTitle = True
oChart.Axes(1).Title.Caption = "Vert Axis"

End Sub

BUT and a really big BUT....
The code does not work with the default PivotChart.  The default PivotChart is based on software called OfficeWebComponents (OWC).  WHen you create a pivotchart in A2003 you automatically get a reference to OWC11.  But the code doesn't work in OWC11- you have to use OWC10 (= OWC for OfficeXP).
This, apparently, IS installed with Office2003 but you can't see it except as an Additional Control on the controls toolbox. So you have to create a new blank form, then from the the Additional Controls add a Microsoft Chart 10 to the form.  This adds the required reference to the VBA code references.
You can then discard the form you were just creating.
You then need to go to Tools>references in the VBA window and make sure you only have OWC10 selected and not OWC11.  The code should then work.

Of course if you're using Office2002 then you don't need to go through all of this as you will have the correct OWC anyway.



0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now