Solved

pivot chart title needs to read from form?

Posted on 2009-04-08
7
257 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

809 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