Pivotchart changing category(x) axis scale


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
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
this might help

How to Programmatically Build a PivotChart View in an Access Form
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.

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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Miss_MimiAuthor Commented:
That worked.  Thank you.
Rey Obrero (Capricorn1)Commented:
U R Welcome!!!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.