?
Solved

Access 2003 - PivotTable - How do you change the "Total Name" value in the properties of a Pivot Calculated Total

Posted on 2009-02-19
1
Medium Priority
?
278 Views
Last Modified: 2012-05-06
This should be a simple one, but for the life of me, I can't find how to change the "total name" property value in the advanced information section of a pivotTable's Calculated total property.

Basically I want it to be a little more descriptive than Total1
PivotTotalPropery.bmp
0
Comment
Question by:Cristal638
1 Comment
 
LVL 2

Accepted Solution

by:
Cristal638 earned 0 total points
ID: 23696922
Here's what I came up with...  I can't seem to find a way to change the name of an existing Calculated total, but if I programmatically create the calculated total I can name it what I want.

Sub Add_TotalTEST()
    Dim vwView As OWC10.PivotView
    Dim ptConstants
    Dim totNewTotal

    Set vwView = Forms(GetDefaultParam("ActiveForm")).PivotTable.ActiveView
    Set ptConstants = Forms(GetDefaultParam("ActiveForm")).PivotTable.Constants
   
    ' Add a new total named "TotalTest" to the current view.
    Set totNewTotal = vwView.AddTotal("TotalTest", vwView.FieldSets("Sales").Fields(0), ptConstants.plFunctionSum)
             
    ' Insert the newly created total into the detail area of the PivotTable.
    vwView.DataAxis.InsertTotal totNewTotal

End Sub
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Question has a verified solution.

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

Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

840 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