Chart Title

S

Steve Y

I have built a successful chart based on a query. In the query, the use is
prompted to enter an employee name and then the data is gathered based on
ONLY this employee. However, I would LIKE this employee name to appear in
the TITLE of the chart. I cannot figure out HOW to do this. I am NOT
experienced in SQL language, so please be kind. Please help.
 
F

fredg

I have built a successful chart based on a query. In the query, the use is
prompted to enter an employee name and then the data is gathered based on
ONLY this employee. However, I would LIKE this employee name to appear in
the TITLE of the chart. I cannot figure out HOW to do this. I am NOT
experienced in SQL language, so please be kind. Please help.

Are you displaying the chart in a report?
No SQL, but a couple of lines of VBA.

Are you trying to have the chart label text show something like this?
"Sales for Joe Blow"
with the name changing according to the query parameters?
If a form is used to enter the parameter...

Code the Report section's Format event that the chart is placed in:

Me!OLEUnbound0.ChartTitle.Text = "Sales for " &
Forms!FormName!EmployeeControl
Me!OleUnbound0.Refresh

Change Forms!FormName!EmplyoeeControl to wjhatever the actual form and
control on the form names are.
The form must be open when the report is run.

If just the query parameter prompt is used:

Me!OLEUnbound0.ChartTitle.Text = "Sales for " & [Enter Employee Name]
Me!OLEUnbound0.Refresh

Change [Enter Employee Name] to exactly whatever the prompt is in the
query

Change OLEUnbound0 to whatever the actual control name is of your
chart control.
 

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