Solved

Change Chart Primary and Secondary X axis maximum values using Code

Posted on 1998-08-30
2
243 Views
Last Modified: 2008-02-01
I have a chart on a form which is linked to a query. All I want to do is be able to
change the Primary and Secondary X axis maximum values using code. I am working in Access97.
0
Comment
Question by:Decorules
2 Comments
 
LVL 9

Accepted Solution

by:
perove earned 200 total points
ID: 1960671
You have to use automation
here is an exapmle that should help you on
sub change()
Dim GraphObj As Object
Dim GraphObj1 As Object
Set GraphObj = Me![MyGraph].Object.Axes(xlValue)'x axixis is default
Set GraphObj1 = Me![MyGraph].Object.Axes(xlValue, xlSecondary)
GraphObj.MaximumScale = 100
GraphObj1.MaximumScale = 300
end sub

perove
0
 

Author Comment

by:Decorules
ID: 1960672
Thanks. Worked great.

I had to open the form in design view first before appling the code. I also had to add MSChart libary to my referances. But once I had worked that out it worked great.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

919 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now