[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 757
  • Last Modified:

Pivotchart changing category(x) axis scale

Hello,

I've created a pivotchart and I need to change the lables spacing and Tick mark spacing based upon the length of time the user has selected.  I.E. if the user wants to show data for 12 months then the lables spacing is 1 and the tick mark spacing is 1, if the user wants to show 36 months then the spacings change to 3 each, etc.

I don't know how to change theses settings in VBA.  And where would be the best place to put the code?  The pivotchart form is a subform of a report.

Thank you in advance.

Miss Mimi
0
Miss_Mimi
Asked:
Miss_Mimi
  • 3
  • 2
1 Solution
 
Rey Obrero (Capricorn1)Commented:
this might help

How to Programmatically Build a PivotChart View in an Access Form
http://support.microsoft.com/?kbid=304143
0
 
Miss_MimiAuthor Commented:
Yeah I actually went through that exercise and it doesn't change the scale settings.

I know it can be done manually, because I change the settings when I was testing the PivotChart.

Thanks.
0
 
Rey Obrero (Capricorn1)Commented:
from the example this will change the value of the y axis

  With objChartSpace.Charts(0).Axes(1)
        .MajorUnit = 200
        .MinorUnit = 20      
  End With

' this will change the value of units in the x axis

  With objChartSpace.Charts(0).Axes(0)
        .MajorUnit = 10
        .MinorUnit = 1      
  End With

just play with the values to get what you want


0
 
Miss_MimiAuthor Commented:
That worked.  Thank you.
0
 
Rey Obrero (Capricorn1)Commented:
U R Welcome!!!
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now