As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread:

Calling all MS Access geeks!

cmsamocmsamo Registered User regular
edited November 2009 in Help / Advice Forum
So, after trawling a lot of sites looking for an answer, I have a question involving PivotCharts. I turn to PA to see if I can solve what i thought was a trivial matter.

I've got a query that I use in a pivotchart, to display data. I've also got a report based on this query that tabulates certain fields from the query. There is a "title" label on the report that includes the paremeter fields that were used to generate the query.


[start_date] = 11/1/2009
[end_date] = 11/2/2009

I run the query with these parameters (which come from date/time pickers on another form, incidentally). Hey presto, my report is generated with the start and end dates at the top, showing the user the dates between which the data is from.

The problem is this - for the life of me, I can't find a way to show these dates on my pivotcharts. I can't add labels, and I can't assign field names, or parameters to a pivotchart title. Ideally, when I generate the graphs, I need to show the dates for which they apply on the graphs (which I export to jpeg for inclusion in powerpoint slides and other documents)

Has anyone done this? Can it even be done?

TLDR - How can I pass a date parameter into the title of a pivotchart?

cmsamo on


  • Options
    AumniAumni Registered User regular
    edited November 2009
    Put a txtbox over the chart, where you want the 'title' to be.

    Open it up in VB and you can do me.txtChartTitle = StartDate & " - " & EndDate in the report_open or pageheader_format routine I think will work too.

    change txtCharttitle to the name of the actual box. This should work. Just delete the existing chart title or make it blank.

    Edit: Actually you got me curious

    This works:
    Dim Test AS String
    Test = StartDate & " - " & EndDate 'you can put me.Label.Value if your startdate/Enddate are in a label or txbox
        Me.Graph140.HasTitle = True
        Me.Graph140.ChartTitle.Caption = Test
    Where Graph140 is your chart/graph name. Put this in your pageheader0_format and/or pageheader0_print routine..

    Aumni on Battlenet: Aumni#1978 GW2: Aumni.1425 PSN: Aumnius
  • Options
    cmsamocmsamo Registered User regular
    edited November 2009
    I solved it before coming back to the forums. This is a simple problem that's been annoying me for ages... Ended up adding code to the OnLoad event of the pivotchart 'form' that I create:
    Private Sub Form_Load()
    Dim strStartDate As String
    Dim strEndDate As String
    strStartDate = Form_SummaryReportsForm.QueryStartDate.Value
    strEndDate = Form_SummaryReportsForm.QueryEndDate.Value
    Me.ChartSpace.ChartSpaceTitle.Caption = "reboots done between " & strStartDate & " & " & strEndDate
    End Sub

    Seems to do the job quite well..

    Thanks... this can be locked

    cmsamo on
Sign In or Register to comment.