Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 26th, 2004, 11:22 AM
Authorized User
 
Join Date: Jul 2003
Location: Stockton on Tees, , United Kingdom.
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default PivotTable programming

I have created a simple pivot table with a Date field as a column.

In the following code segment shown below, the lines:-

    Set fset1 = .FieldSets("LabReceivedDate By Mon")
    .ColumnAxis.InsertFieldSet fset1

work, but they insert all the child date fields Years, Quarters, Months etc.
I only want to insert and display the Years and Months. -

Can any one help with the syntax?


Code segment start:

DoCmd.OpenForm strFormName, acFormPivotTable
Set frm1 = Forms(strFormName)

With frm1.PivotTable.ActiveView
    'Assign fieldset members to the column, row, and detail sections of
    'the PivotTable
    Set fset1 = .FieldSets("ClientCode")
    .FilterAxis.InsertFieldSet fset1

    Set fset1 = .FieldSets("LabReceivedDate By Mon")
    .ColumnAxis.InsertFieldSet fset1

    Set fset1 = .FieldSets("Vessel")
    .RowAxis.InsertFieldSet fset1
    Set fset1 = .FieldSets("LabRef")
    .DataAxis.InsertFieldSet fset1

End With
'Close form with its PivotTable view
DoCmd.Close acForm, strFormName, acSaveYes
Code segment end:



Cheers Ray
__________________
Cheers Ray




Similar Threads
Thread Thread Starter Forum Replies Last Post
relationship in PivotTable with diferents tables juliano_sb Visual Studio 2005 0 July 17th, 2008 09:44 AM
pivottable form Vince_421 Access VBA 2 May 26th, 2006 07:52 AM
PivotTable-access rigths for columns harmony82 Access VBA 0 July 19th, 2005 04:28 PM
excel 97 & pivottable pilmart Excel VBA 1 November 18th, 2003 08:44 AM
PivotTable Column won't go Invisible Stoney Excel VBA 0 November 5th, 2003 07:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.