Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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 June 2nd, 2004, 06:58 AM
Registered User
 
Join Date: Apr 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Pivot tables in Access 2002

Does anyone know how to programmatically contract (as aooposed to expand) all the levels in a pivot table. When the user opens the pivot table he just wants to see the parent rows of a hierarchy of 4 levels

eg would like to see top level only:

Country1 +
Country2 +

rather than:

Country1
  County/State1
    City1.1
  County/State2
     City2.1
CountryB
etc




 
Old June 3rd, 2004, 02:25 AM
Authorized User
 
Join Date: Jul 2003
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try this code segment:

Dim frm1 As Access.Form

'Open a form name strFName
DoCmd.OpenForm strFName, acFormPivotTable
Set frm1 = Forms(strFName)

'Hide detail rows
Screen.ActiveDatasheet.PivotTable.ActiveData.HideD etails
frm1.PivotTable.AllowDetails = False



Cheers Ray





Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA for Pivot Tables stealthdevil Excel VBA 3 March 21st, 2007 04:01 PM
how to work pivot tables malli_kv2 Access 1 March 16th, 2007 06:34 AM
Formula in Pivot tables JPC Excel VBA 1 February 20th, 2007 01:27 PM
International Pivot Tables noldrini Excel VBA 0 February 8th, 2006 12:54 PM
Pivot Tables smartgir Excel VBA 0 May 12th, 2004 10:08 AM





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