Chart Dynamic title

  • Thread starter Thread starter sergiosr
  • Start date Start date
S

sergiosr

Hi,

I have created a chart which is run from a query. When the chart is
opened, the user is prompted to enter a parameter i.e. [Please enter
name] - how can i store the value that the user enters and use it in
the title of my chart.
For example,
If the user puts in "Jones", and presses enter, i would like somehow
for the chart title to read - "Jones"

Thanks,

Sergios
 
Hi,

I have created a chart which is run from a query. When the chart is
opened, the user is prompted to enter a parameter i.e. [Please enter
name] - how can i store the value that the user enters and use it in
the title of my chart.
For example,
If the user puts in "Jones", and presses enter, i would like somehow
for the chart title to read - "Jones"

Thanks,

Sergios

It's best to use a form for the parameter entry. Instead of
[Please enter name]
as parameter prompt, use
forms!FormName!ControlName
in the query.

Code the Section Format Event of whatever section of your report the
graph is place in, (i.e. Report Header Format event) something like
this:

Me!OLEUnboundName.ChartTitle.Text = "Sales for " &
Forms!FormName![ControlName]

Change the control and form names to whatever your actual names are.
The form must be open when the report is run.
You can close the form when the report closes.
In the report Close event:
DoCmd.Close acForm, "FormName"

I believe Access Help has a section on creating a parameter form:

Form + Parameter + Create a parameter query + Create a custom dialog
box to prompt for your parameter query's criteria
 
Hi and thanks for your help.

I did what you told me and i get the following error:

Run time error 2465
Microsoft Office Access cannot find the field OLE UnboundName reffered
to in your expression

Am I doing something wrong?

Thanks,

Sergios
 
Hi and thanks for your help.

I did what you told me and i get the following error:

Run time error 2465
Microsoft Office Access cannot find the field OLE UnboundName reffered
to in your expression

Am I doing something wrong?

Thanks,

Sergios

By default, Access names your graph control OLEUnbound1 (or 2 or 3,
etc.) You can name it anything you want.

Did you change my OLEUnboundName to the actual name of your graph
control?
Click on the control. Select Properties + Other tab. The name of the
control is whatever is shown as the Name property.
 
I changed that and I no longer have that problem.

Now i get this error message though:

Run time error 1004
Unable to set the Text property of the ChartTitle class

I guess I am doing something wrong again...

Thanks,

Sergios
 
Hello!Everyone.

I want to buy a set of software of Office.

How much is it,please?

Who can answer me?

Thank you very much !

Tess.Yang.
 
Back
Top